Subject Re: [firebird-support] Compound indexes and plans
Author Ann W. Harrison
Rick Debay wrote:
>
> Given an index:
>
> CREATE ASC INDEX IDX_A ON TABLE_A (COL_1, COL_2, COL_3);
>
> SELECT 1
> FROM TABLE_A
> WHERE COL_1 = ? AND COL_2 > 0 AND COL_3 = ?
>

COL_1 and COL_2, the latter badly. Generally speaking, don't
use compound keys unless you need them for uniqueness. Firebird
does remarkably well at using multiple indexes for a single
query... OK, sometimes it used too many, but V1.5 and V2
are more moderate.

Regards,


Ann