Subject Re: Compound Index
Author Adam
--- In, "pokka_chi" <pokka_chi@...>
> Does anybody know how compound index in FB works? I'm working on a web
> application that requires the display of a table's records in pages.
> The table's primary key is a compound index of 2 fields. What I need to
> do is to get a page (around 30 records) of records start from the last
> record of the previous page.

Firebird supports both declared compound keys as well as the
(relatively unique) ability to combine indices on different fields at

Most of the time, it is not worth actually declaring the compound key,
but rather individually index both fields. There are of course exceptions.

> How do I specify a condition for (Column1, Column2) > (1, 2)? Does FB
> support optimization for the use of compound index?

That is the optimisers job, not something for you to worry about.

where Column1 > 1 and Column2 > 2