Help on First_Rows [message #195218] |
Wed, 27 September 2006 07:54 |
rajaobj
Messages: 9 Registered: September 2006 Location: Chennai
|
Junior Member |
|
|
Hi Friends,
I am new to SQL Tuning,I have query where it has /*+ FIRST_ROWS */.I hope this will returned the first row asap.when i run the explain plan for this the cost is shown like this
SELECT STATEMENT Optimizer=HINT: FIRST_ROWS (Cost=45964 Card
=14981 Bytes=2067378)
The same query when i run without the hint i am getting the cost as
SELECT STATEMENT Optimizer=ALL_ROWS (Cost=9888 Card=14981 By tes=2067378)
why is it so..
Regards,
Raja
[Updated on: Wed, 27 September 2006 07:55] Report message to a moderator
|
|
|
Re: Help on First_Rows [message #195219 is a reply to message #195218] |
Wed, 27 September 2006 07:56 |
JSI2001
Messages: 1016 Registered: March 2005 Location: Scotland
|
Senior Member |
|
|
Cost is a figure used by the optimizer for various explain plans for the SAME query. Comparing cost values across multiple statements is pointless.
|
|
|
|
|
|
|
|
|
Re: Help on First_Rows [message #195309 is a reply to message #195247] |
Wed, 27 September 2006 20:15 |
rleishman
Messages: 3728 Registered: October 2005 Location: Melbourne, Australia
|
Senior Member |
|
|
If you want the first row returned as quickly as possible, and you suspect it could be better, post the entire SQL and the entire EXPAIN PLAN here and we'll give you an opinion on whether it can be tuned.
Now, this is important. You MUST enclose your SQL in [code] and [/code] tags, otherwise we can't (and won't) read it. Use the button to do this.
Ross Leishman
|
|
|