when I have table with 100 rows of data
fetch size is set - 10 rows
select returns - 50 rows
and the question is what returns sql%rowcount ?
it is 50 or 10 ??
... and if the only purpose is to populate the "cnt" variable with the number of records in "bigtable", then the Count(*) methodology is more logical, and easy to follow -- even if the ROWCOUNT method were a little faster (which i really really doubt) I still wouldn't use it.
You dont have to doubt(really really) it, it will not be faster than count method for sure...
I was being polite, but also trying to make the general point that there is a "logically correct" methodology to doing most things, especially simple things like this.
Even if there is a tricky method to get a slightly faster result, if the methodology is non-intuitive then I would probably not adopt it, just for the sake of future maintainers of the system.
Bookmarks