Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Performance
HI,
Use a GROUP BY instead.
DISTINCT can be really slow sometimes,
especially with joins.
SELECT T1.FK0,T1.FK00,T3.PK3,T1.VALUE
FROM
T1,T2,T3,T4,T5
WHERE ... (joins and filters)
GROUP BY T1.FK0,T1.FK00,T3.PK3,T1.VALUE
ORDER BY 1,2
Argosy
In article <8339ad$nnc$1_at_wanadoo.fr>,
"sofresud" <sofresud_at_wanadoo.fr> wrote:
>
> I got some performance problems,
> In fact the SQL statement is inside a PL/SQL procedure
> This is my SQL Select Statement i would like to improve :
> Any help is very welcome
>
> SELECT DISTINCT T1.FK0,T1.FK00,T3.PK3,T1.VALUE
> FROM
> T1,T2,T3,T4,T5
> WHERE
> T5.PK5 = :X5 AND T2.FK5 = T5.PK5 AND
> T2.FK0 = T1.FK0 AND T5.PK5 = T3.FK5
> AND T4.PK4 = T5.FK4 AND
> (T1.FK0 > :X0 OR (T1.FK0 = :X0 AND T1.FK00 > :X1 ))
> AND (T3.FK00 = T1.FK00 OR T4.FK00 = T1.FK00) ORDER BY 1,2
>
> TKPROF statistics
>
> call count cpu elapsed disk query current
> rows
> ------- ------ -------- ---------- ---------- ---------- ----------
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Wed Jan 05 2000 - 15:05:18 CST
![]() |
![]() |