Re: How to speed up this query?

From: Dermot McNulty <dmcnulty_at_uk.mdis.com>
Date: 1996/02/22
Message-ID: <4ghv66$je5_at_relay2.uk.mdis.com>#1/1


surfer_at_carser.adminsrv.emich.edu (Alex Sharifi) wrote:

>I'm executing an embedded sql statement that just takes forever.
 

>select distinct view1.i_mfr_id, view1.i_mfr_des,
> view1.c_code, tablex.c_code
>from view1, tablex
>where view1.c_code = tablex.c_code;
 

>I know that the 'distinct' directive is the "killer"
>here. Any way to optimize this?
 

>Appreciate any help....Alex Sharifi
Try increasing sort_retained_size and sort_area_size in init.ora. Big valuee here go in the way of helping internal sorts/merges. DISTINCT, GROUP BY etc uses sorts, so it can improve performance by reasonal amounts. Bigger gains can only be made by looking at view definition and looking for indexing oppurtunities on tables.

Hope this helps. Received on Thu Feb 22 1996 - 00:00:00 CET

Original text of this message