Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Re: Long-running PL/SQL function (short)
('binary' encoding is not supported, stored as-is)
Try to use INSERT ... SELECT ... (or UPDATE (in-line view)) wherever possible. SQL was designed as a language with set-handling capabilities, most people seem to have forgotten about it ...
>I already made recommendations to remove the
>DISTINCT and ORDER BY clauses
>in most SQL statements. I was told that the
>distinct is necessary to
>remove redundant data and do some additional
>clean-up.
Don't believe them. In 99% of cases the redundant data comes from a screwed-up join. Either a join condition is missing, or, more frequently, developers refer into the FROM clause to a table which is required neither to get data to be returned in the SELECT list nor to join tables from which SELECT list data come from, but just for an existence test. Existence tests belong to subqueries, either correlated or uncorrelated. If this existence test is just an additional check and the global volume returned is relatively small, EXISTS should do. Otherwise IN (subquery), with possibly some /*+ USE_HASH */ or /*+ USE_MERGE */ hint.
> I believe that
>they want the order by to make their QA effort
>easier and confirm that the
>data is still valid and matches across to other
>databases. However, I am
>trying to push to get the ORDER BYs out at least.
>
>Thanks again for your feedback.
>
>Cherie
>
>
>
>
>
> Stephane
>
>
> Faroult To:
>Multiple recipients of list ORACLE-L
><ORACLE-L_at_fatcity.com>
> <sfaroult_at_orio cc:
>
>
> le.com> Subject:
> Re: Long-running PL/SQL function (short)
>
> Sent by:
>
>
> root_at_fatcity.c
>
>
> om
>
>
>
>
>
>
>
>
> 01/07/03 01:39
>
>
> PM
>
>
> Please respond
>
>
> to ORACLE-L
>
>
>
>
>
>
>
>
>
>
>
>
>Have the procedure rewritten by somebody with a
>little experience.
>Getting rid of statements inside loops, DISTINCT
>and ORDER BY which are
>rarely necessary when moving data from a table to
>another table would be
>good places to start.
>
>--
>Regards,
>
>Stephane Faroult
>Oriole Software
>--
>Please see the official ORACLE-L FAQ:
>http://www.orafaq.net
>--
>Author: Stephane Faroult
> INET: sfaroult_at_oriole.com
>
>Fat City Network Services -- 858-538-5051
>http://www.fatcity.com
>San Diego, California -- Mailing list and
>web hosting services
>To REMOVE yourself from this mailing list, send an
>E-Mail message
>to: ListGuru_at_fatcity.com (note EXACT spelling of
>'ListGuru') and in
>the message BODY, include a line containing: UNSUB
>ORACLE-L
>(or the name of mailing list you want to be removed
>from). You may
>also send the HELP command for other information
>(like subscribing).
>
>
>
>
>
>--
>Please see the official ORACLE-L FAQ:
>http://www.orafaq.net
>--
>Author:
> INET: Cherie_Machler_at_gelco.com
>
>Fat City Network Services -- 858-538-5051
>http://www.fatcity.com
>San Diego, California -- Mailing list and
>web hosting services
>To REMOVE yourself from this mailing list, send an
>E-Mail message
>to: ListGuru_at_fatcity.com (note EXACT spelling of
>'ListGuru') and in
>the message BODY, include a line containing: UNSUB
>ORACLE-L
>(or the name of mailing list you want to be removed
>from). You may
>also send the HELP command for other information
>(like subscribing).
>---------------------------------------------------
>------------------
>---------------------------------------------------
>------------------
Regards,
Stephane Faroult
Oriole
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Stephane Faroul INET: sfaroult_at_oriolecorp.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Wed Jan 08 2003 - 03:33:43 CST
![]() |
![]() |