-
Speed
In the below two queries which is faster
1.Select * from Test_tbl where test_no between 1 and 5;
2.Select * from Test_tbl where test_no >= 1 and test_no <= 5;
here test_no is Number datatype.
Last edited by bk_raavi; 06-03-2003 at 10:52 AM.
-
I think that the answer will probably be about the same. But whether the queries are fast or slow depend more one the structure of the table and the cardinality of the data.
-
The result set from each query given above is different, how can you compare them for performance?
Jim
Oracle Certified Professional
"Build your reputation by helping other people build theirs."
"Sarcasm may be the lowest form of wit but its still funny"
Click HERE to vist my website!
-
What *are* you people talking about?
Check the execution plans. Check the stats. Check the times.
They are exactly, precisely, perfectly the same.
It is simply 2 different ways of writing the exact same command in Oracle. Not simply logically-equivalent, but actually the same. Oracle simply translates the first statement to the second one before coming up with a plan.
- Chris
-
Originally posted by chrisrlong
What *are* you people talking about?
Check the execution plans. Check the stats. Check the times.
They are exactly, precisely, perfectly the same.
It is simply 2 different ways of writing the exact same command in Oracle. Not simply logically-equivalent, but actually the same. Oracle simply translates the first statement to the second one before coming up with a plan.
- Chris
I would check all of that but I have a job that actually pays. I did tried to point tbk_raavi in the right direction. Actually I did run a quick test and they looked the same. However, if I said they were the same someone would come along and say that somehow they were different.
-
Good CYA!!
- Chris
-
That's Cover Yer Arse, BTW, not See(C)Ya.
Just doing some CYA of my own
- Chris
-
Originally posted by chrisrlong
They are exactly, precisely, perfectly the same.
they are now, but before bk_raavi edited his post the second SQL read ...
Select * from Test_tbl where test_no >= 1 and test_no <= 10;
-
Originally posted by chrisrlong
That's Cover Yer Arse, BTW, not See(C)Ya.
Just doing some CYA of my own
- Chris
I should have figured it for the former. I think that might be on my mbo ( mayhem by objective )
-
Originally posted by slimdave
they are now, but before bk_raavi edited his post the second SQL read ...
Select * from Test_tbl where test_no >= 1 and test_no <= 10;
Ah, that sneaky little so-and-so
- Chris
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|