which of the following is better to find the number of rows in a table? 1. count(1) 2. count(*) 3. count(rowid)
Please follow the link http://www.brentozar.com/archive/2014/02/count-number-rows-table-sql-server/
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.
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.
select * from dba_users;
select * from employee
Which of the following is not a schema object: Indexes, tables, public synonyms, triggers and packages?