On Sep 7, 2006, at 3:32 PM, <prasad.ramisetti@stripped> wrote:
>
> I need to know the number of rows that a query will return before
> actually executing the query. So I am sending select count(*) before
> sending select *. Actually I need to reject queries if the number of
> records that it will return is huge, to avoid my server running out of
> memory. My application has a huge database of around 10 millions.
It sounds like you program allows ad-hoc queries, so why don't you
just limit the number of rows returned by a select?
For example you could limit the number of rows to 1001. If the server
returns 1001, then display 1000 and tell the user there are actually
more rows. The user should then apply further conditions.