Subject RE: [firebird-support] Re: Out-of-memory problem
Author Alan McDonald
> When you say it's a good idea to limit the number of records
> returned by a query, I'm wondering how best to implement this.
>
> Obviously it could be done by having a series of SQLs, each with an
> appropriate WHERE clause. Is there any neater, automatic way of
> achieving this (through adjustment of Firebird/Delphi/OS parameters)?

Definitely. There should be a hierarchical structure to your data somewhere.
e.g. districts, schools, buildings, rooms, windows.....
There should be a way of seeing the windows which apply to one room in a
list of rooms, in a list of buildings, in a list of schools in one district.
Maybe you get my drift.

These views can be connected by parametised queries as you suggest. Or you
can use nested FOR SELECT loops in stored procedures to do processing across
an enormous number (perhaps 1.1 million) rows. This processing can be
dramataically faster than selecting all rows in the FOR SELECT loop and
making one pass thru all rows.

Building an interface with this kind of browsing or navigation is very much
a part of creating a sound SQL based application.

Alan