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: Jim Kennedy <kennedy-family_at_attbi.com>
Date: Fri, 10 May 2002 01:32:03 GMT
Message-ID: <nqFC8.6957$UV4.52@rwcrnsc54>


Pablo is correct. Just running it once is not very useful. (had to go through all the parse, bind etc.) Also the 2nd case has the values cached in memory from the first. (the data). What you want to do is use bind variables, open the cursor once, rebind when the values change and reexecute.
Jim
"Pablo Sanchez" <pablo_at_dev.null> wrote in message news:okCC8.826$eR3.60935_at_news.uswest.net...
>
> "FC" <flavio_at_tin.it> wrote in message
> news:wiAC8.42357$zW3.473798_at_news1.tin.it...
> > 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 ?
> >
>
> What happens if you execute 1. multiple times? I believe you only see
> the 'hit' once. No?
> --
> Pablo Sanchez, High-Performance Database Engineering
> mailto:pablo_at_hpdbe.com
> http://www.hpdbe.com
> Available for short-term and long-term contracts
>
>
Received on Thu May 09 2002 - 20:32:03 CDT

Original text of this message

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