Subject Re: [firebird-support] Limit the query via time or number of records
Author masotti
On 14/12/2010 18:21, Ann W. Harrison wrote:

> > On 14/12/2010 17:09, kokok_kokok wrote:
> >> I am building a Web server with Firebird 2.5. There are few clients (<10
> >> concurrently) but they can frozen the server if they do not use
> >> reasonable limits in their consults (for example they could query 20
> >> years of data, it means millions of records).
> >>
> > To change programaticcally, I'd change
> > "SELECT" to "SELECT FIRST 1000"
> > in critical statements.
> >
>
> That's a risky solution. There are many circumstances in which finding
> the first 1000 of something results in Firebird finding all of the
> "something", sorting them, and returning the first 1000 in sorted order.
> Not at all what is wanted.
True: the time consuming operation to collect and sort all data isn't
avoided when there's not an useful index. Missed that point: thanks.
It's a web application, and only transmission on the wire of million of
records can be avoided with that change.
Re-reading original question I'm not sure that there are many other
quick choices in pure SQL without more details on subject.

Ciao.
Mimmo.