oracle - sql count performance -


possible duplicate:
count(*) vs count(1)

if have table, 'id' primary key, these 2 commands have different performance ?

select count(*) t; select count(id) t; 

thanks

these have same performance. in databases, count() results in scan of table or available indexes. whether or not uses index instead of table depends on query optimizer. if optimizer smart enough use index, should smart enough in both cases.

using available metadata tables, can number of rows in table mroe efficiently using count() query.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -