Home » SQL & PL/SQL » SQL & PL/SQL » General sql question
General sql question [message #4911] Mon, 20 January 2003 13:50 Go to next message
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 Go to previous message
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
Previous Topic: It's really important ! So please look at it!
Next Topic: dbms_output:urgent
Goto Forum:
  


Current Time: Fri Nov 14 19:30:56 CST 2025