Just wondering if any of you people use Count(1)
over Count(*)
and if there is a noticeable difference in performance or if this is just a legacy h
In SQL Server, these statements yield the same plans.
Contrary to the popular opinion, in Oracle they do too.
SYS_GUID()
in Oracle is quite computation intensive function.
In my test database, t_even
is a table with 1,000,000
rows
This query:
SELECT COUNT(SYS_GUID())
FROM t_even
runs for 48
seconds, since the function needs to evaluate each SYS_GUID()
returned to make sure it's not a NULL
.
However, this query:
SELECT COUNT(*)
FROM (
SELECT SYS_GUID()
FROM t_even
)
runs for but 2
seconds, since it doen't even try to evaluate SYS_GUID()
(despite *
being argument to COUNT(*)
)