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
Post a Comment