Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> count(*) v. count(pk)
Hi folks.
Saw a post recently where someone recommended doing a count(pk) instead of a count(*) as count(*) always does a full table scan.
Questions:
I tested this theory on a table with 250,000 rows and a one-column PK using both queries, and got no difference in response time. I can think of no way to test this on a table with a 2+ column PK as count() accepts only one argument.
This isn't of prime importance, more to settle an internal debate here.
Thanks,
-Brendan
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
Received on Mon Apr 27 1998 - 12:45:19 CDT
![]() |
![]() |