Home » SQL & PL/SQL » SQL & PL/SQL » query
icon6.gif  query [message #237109] Sat, 12 May 2007 02:57 Go to next message
prachi.mgorwadkar
Messages: 75
Registered: May 2007
Location: Pune
Member

A query runs faster for the second time.
Is this true? If so, WHY?
Re: query [message #237113 is a reply to message #237109] Sat, 12 May 2007 04:06 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Sometimes it will, sometimes it won't it depends on lots of things.
Have you tested it? What happened? Who told you this? Have you read any documentation on this? Do you know where to get the documentation?
Re: query [message #237162 is a reply to message #237109] Sat, 12 May 2007 15:14 Go to previous messageGo to next message
Barbara Boehmer
Messages: 8620
Registered: November 2002
Location: California, USA
Senior Member
The second query will usually run faster, because it does not have to redo all of the PARSING, if the first query is still in the SGA. Search the documentation for PARSING and SGA and BIND VARIABLES for more information.
Re: query [message #237165 is a reply to message #237109] Sat, 12 May 2007 15:32 Go to previous messageGo to next message
BlackSwan
Messages: 25033
Registered: January 2009
Location: SoCal
Senior Member
Also it MAY run faster because some or all of the result set is already in the SGA (memory) & avoids going to disk to get the returned data.
Re: query [message #237307 is a reply to message #237165] Mon, 14 May 2007 02:38 Go to previous messageGo to next message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
It also MAY run faster if your disk hardware implements some kind of cache independent of Oracle.
Re: query [message #263280 is a reply to message #237109] Wed, 29 August 2007 10:27 Go to previous messageGo to next message
pvannapurna
Messages: 8
Registered: October 2006
Location: Hyderabad
Junior Member

if query runs slower may depends:

1. when run the query for first time it has to fetch the data
pertaining to the conditions, hence it takes time it is not there in SGA.
2. If it is a simple query, it runs faster.
3. Depends on the complexity in query.
4. Also on the server performance.
5. No.of joins in query.
6. If joins r more n the no.of tables in database is more
some times the performance will degrade.

if query runs faster may depends:

1. the has been fetched n its there in CACHE memory ( SGA).
2. and imagine all the above conditions in reverse manner.

Regards

[mod-edit] I removed all illiterate IM words, making this posting sound even more illiterate.

[Updated on: Wed, 29 August 2007 12:29] by Moderator

Report message to a moderator

Re: query [message #263292 is a reply to message #263280] Wed, 29 August 2007 10:57 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
1. True, but this point was already made 4 MONTHS AGO.
2. Has nothing to do with the question.
3. Same as 2
4. Point has already been made.
5. Same as 2 and 3.
6. Please, Please, please do not use IM speak on this site.

Since your post added nothing to the thread, shall we put it to rest now?
Re: query [message #263296 is a reply to message #263280] Wed, 29 August 2007 11:01 Go to previous message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It's time for you to read and follow OraFAQ Forum Guide.

Regards
Michel
Previous Topic: EXPLAIN PLAN doesn't show view names
Next Topic: help about Utl_smtp
Goto Forum:
  


Current Time: Fri Dec 02 16:56:19 CST 2016

Total time taken to generate the page: 0.11450 seconds