[egenix-users] cursor.rowcount abnormalities and performance
fuf at mageo.cz
Thu Jul 31 15:10:31 CEST 2003
Moore, Paul wrote:
>I don't know about MS, but under Oracle (where "SELECT @@ROWCOUNT"
>definitely doesn't work, but there are equivalents) getting the
>rowcount is *extremely* costly compared to just fetching the first
>row. Imagine a 10 million row table. You can get the first row just by
>a single read, but to count the number of rows, you have to read the
>whole table before returning the first row.
if you meant SELECT COUNT(*) as synonym to @@rowcount then you are on a
wrong track. @@rowcount is a variable which is filled every time you do
a SELECT so the overhead should be imho minimal.
fuf (fuf at mageo.cz)
More information about the egenix-users