Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: question for the wise?

Re: question for the wise?

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Thu, 09 May 2002 19:47:50 GMT
Message-ID: <3CDAD25B.9C109851@exesolutions.com>


FC wrote:

> Hi folks,
> here is a very simple question concerning good programming practice versus
> performance.
> I hope it will open up one of those neverending debates I like so much.
>
> 1.
> ===========================
> Select a,b,c from my_table
> where d = my_own_constants.XYZ
>
> say it takes 2 seconds.
>
> 2.
> ===========================
> Select a,b,c from my_table
> where d = 'XYZ'
>
> say it takes 1.5 seconds.
>
> my_own_constants is a bodyless package specification where I list all the
> constant values I need that might change in the future.
>
> Question:
> how can I increase the performance of solution 1 which is clearly easier to
> maintain but 25% slower in performance than solution 2 ?
>
> Thank you
> Flavio

Factor this one into the mixture:

SELECT a,b,c
FROM my_tble
WHERE d = (

   SELECT 'XYZ'
   FROM dual);

It's always been one of my favorites.

Daniel Morgan Received on Thu May 09 2002 - 14:47:50 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US