Subject | Re: [firebird-support] Select count(*) too slow |
---|---|
Author | Thomas Steinmaurer |
Post date | 2012-02-08T19:26:56Z |
> i uderstand why the count(*) can be very slow because it's must read all the data to know how many reccord ... but is their any way to give a limit to the count(*) ? for exemple if more than 10000 row read then stop the count(*) and return 10000This is something I can think of:
>
> something like
> select min(10000, count(*))
select count(*) from (
select first 10000 pk_field from yourtable
)
Which basically creates 10000 non-indexed reads.
--
With regards,
Thomas Steinmaurer (^TS^)
Firebird Technology Evangelist
http://www.upscene.com/
http://www.firebirdsql.org/en/firebird-foundation/