Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SELECT COUNT(APPROXIMATELY *) FROM a WHERE b=c;
Here's an optimistic option.
CBO returns a computed cardinality on
explain plan, so you could (in principle)
return that as an indication of the number
of rows to be returned.
-- Jonathan Lewis http://www.jlcomp.demon.co.uk Next Seminars UK June / July Australia July / August http://www.jlcomp.demon.co.uk/seminar.html Connor McDonald wrote in message <3D063FF5.263D_at_yahoo.com>...Received on Tue Jun 11 2002 - 14:59:20 CDT
>Monty wrote:
>>
>> Hello, every now and then I go to a website, perform a search, and it
>> comes back and says "found APPROXIMATELY ? records".
>>
>> A case in point is "http://asktom.oracle.com" (click on
>> Search/Archives, type in something in the search box, and press go)
>> and I am probably not wrong in assuming there is an Oracle database
>> behind this web site.
>>
>> How can an SQL search be formulated to find approximately the number
>> of hits (which I'm assuming is just a quick preview of a very large
>> database with a query before actually doing the 'real' query) ?
>>
>> Monty
>
>I'm guessing either
>
>a) intermedia indexes only being refreshed every 'n' hours
>b) using a sample clause to speed the results
>
![]() |
![]() |