top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Oracle: which of the following is better to find the number of rows in a table?

+1 vote
568 views

which of the following is better to find the number of rows in a table?
1. count(1)
2. count(*)
3. count(rowid)

posted Mar 9, 2015 by Suchithra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

0 votes
answer Mar 9, 2015 by Amit Kumar Pandey
0 votes

the answer is 1. and 3.

The function count() executes faster when given a criteria/value which is quicker to resolve in the sql processing mechanism.Thus, an integer or rowid are faster to resolve than an '*'which is a wild card symbol for all the colums in a table and hence it is more time consuming.

answer Mar 10, 2015 by Arun Gowda
Similar Questions
+2 votes

Its a very basic question but it would be good if anyone can answer with some explanations. When we type select * from dba_users; in sql plus it will show N rows selected and total records whereas when we type select * from employee it would show only records but not the total count.

+2 votes

Which of the following is not a schema object: Indexes, tables, public synonyms, triggers and packages?

...