| General sql question [message #4911] |
Mon, 20 January 2003 13:50  |
Suresh
Messages: 189 Registered: December 1998
|
Senior Member |
|
|
Hi,
I have a general SQL question. Can you please answer this.
Do the following sqls take same time to execute?
1. select count(*) from table where <condition>
2. select * from tablw where <condition>
The <condition> is same in both the sqls.
Thanks,
Suresh
|
|
|
|
| Re: General sql question [message #4921 is a reply to message #4911] |
Tue, 21 January 2003 00:01  |
 |
Maaher
Messages: 7065 Registered: December 2001
|
Senior Member |
|
|
The cost will be different.
1. Will use most probably a fast full table scan.
2. Will use a full table scan (the slowest table access).
It can vary a little bit depending on your system, but the second statement is the heaviest possible in a normal Oracle environment.
MHE
|
|
|
|