easier COUNT(*)
func.count()
with no arguments should emit COUNT(*)
Comments (5)
-
repo owner -
reporter the axis is different for a
*
in COUNT(). it doesn't mean "expand to all columns" like it would in SELECT , it's more "expand to all rows" with no further evaluation whatsoever. it shouldn't ever be slower than COUNT(1). i'd bet lots of dbs rewrite a contant, true argument for COUNT() as COUNT() interally... -
repo owner the original thread is at: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1156159920245
Its pretty clear that very old versions of oracle (like, version 7 or earlier) had some internal expansion happening with
count(*)
...that idea is very widespread and a couple of articles mention "these days, count(1) and count(*) are the same". but pointless now, should probably take it out of the docs (i think a lot of examples reference it). -
-
repo owner - removed milestone
Removing milestone: 0.5.0 (automated comment)
- Log in to comment
well it looks like my ancient wisdom on this is wrong, though I can't find the original source:
http://www.thescripts.com/forum/thread64728.html