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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Parsing: How Oracle determines two sql statements are same?

Re: Parsing: How Oracle determines two sql statements are same?

From: <sybrandb_at_yahoo.com>
Date: 13 Apr 2005 06:30:25 -0700
Message-ID: <a1d154f4.0504130530.13141cce@posting.google.com>


"Googly" <himigupta_at_yahoo.co.uk> wrote in message news:<1113383374.854266.213670_at_f14g2000cwb.googlegroups.com>...
> Hi,
>
> When a new SQL statement is encountered, Oracle uses Hashes algorithm
> to generate a hash value. OK so far.
>
> Now if exactly the statement is reissued, how does Oracle know that its
> the same satement as before? Does it reparse it, generates the hash
> value and then know that this hash value already exists in the shared
> pool?
>
> I want to know if the same sql statment is executed twice, is it parsed
> twice or only once? (We have a statement that is taking 30 seconds for
> parsing and hence want to know exactly how many times will this
> statement be parsed)?
>
> I would appreciate if you copy your response to
> himigupta_at_yahoo.co.uk.nospam
>
> Thanks in advace,
>
> Himi

There is hard parse and soft parse. The statement is hashed first and soft parsed when the hash is in the shared pool. If the hash is not the shared pool,it is hard parsed. So when you submit identical statements it is hard parsed once, and soft parsed for all subsequent executions.

--
Sybrand Bakker
Senior Oracle DBA
Received on Wed Apr 13 2005 - 08:30:25 CDT

Original text of this message

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