[rt-devel] A bit of oracle clue?

Marco Nijdam marco at West.NL
Fri Mar 30 04:30:39 EST 2001


As quoted from Jesse:
> 
> 
> 
> On Tue, Mar 27, 2001 at 05:55:18PM +0200, Marco Nijdam wrote:
> > Jesse,
> > 
> > Or do you need a distinct for a join over multiple tables?
> 
> Yep. you got it.
> 
> 
> > Can't you work around it by sorting the select and removing doubles
> > in the Perl code?
> 
> Yes. but that's really really ugly. I'd prefer not have to do this, 
> since it's well, fairly standard SQL and the database is going to be
> faster if it's doable, etc. and it just makes everything more complex :/

BTW I don't think it is (database wise) efficient to do a DISTINCT on
the whole row, if there are large texts in the row. Just checking
the primary keys should be enough. I.e. a two step approach to first
select the primary keys you need and then getting the long texts
that belong to them (maybe use a nested query).

Though I must admit that the query optimizer may
be very smart (especially Oracle's) so it might already automatically
check only primary keys for a DISTINCT.

Kind regards,
--
-- Marco Nijdam,         marco at west.nl
-- West Consulting B.V., Delftechpark 5, 2628 XJ  Delft, The Netherlands
--                       P.O. Box 3318, 2601 DH  Delft
-- Tel: +3115 219 1600,  Fax: +3115 214 7889




More information about the Rt-devel mailing list