Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> good guess for final record number in SELECT?
Short question:
Is there some way to estimate the the row count for
some SELECT statement already prepared and bound to a cursor
without actually fetching all the rows?
Oracle 9i, Linux, language Python
Here is our problem:
Given one possibly huge SELECT statement which is bound to a cursor. We did not fetch any row yet.
A GUI Tool wants to present a good guess of the final row count to the end user.
So, someone suggested to count the number of rows a certain huge SELECT will return by using 'SELECT COUNT(*) FROM (original-query)' before the 'original-query' is done and use that as the final correct row count.
I guess the server will have to do 'original-query' twice and the count()ed row count will be just a guess, because of concurrent INSERT and DELETE operations. (we are working in READ COMMITTED)
So, is there something significantly faster than COUNT()? Something like 'select ESTIMATE_COUNT(*) from (original-query)'?
Thank you,
Volker
-- Volker ApeltReceived on Wed Feb 26 2003 - 05:32:38 CST
![]() |
![]() |