[firebird-support] Re: Optimiser not using expected index

2014-06-01 Thread s3057...@yahoo.com [firebird-support]
Thanks Dmitry, That explains its avoidance of this index. My issue is that a lot of queries are of similar form, so I was hoping to create some sort of index/indices to improve performance. I sometimes need equality to specific TABLE1ID records, but often it is a range (or an exists on another

[firebird-support] Re: Optimiser not using expected index

2014-05-29 Thread Dmitry Yemanov dim...@users.sourceforge.net [firebird-support]
30.05.2014 06:11, s3057...@yahoo.com wrote: > CREATE INDEX IX_TA BLE2_EXPECTED ON TABLE2 (TABLE1ID, VALIDFROM, VALIDTO); > COMMIT; > > -- SIMPLE QUERY > > SELECT * > FROM TABLE2 T > WHERE T.TABLE1ID BETWEEN 1000 AND 1999 > AND T.VALIDFROM <= CURRENT_DATE > AND T.VALIDTO >= CURRENT_DATE > > The sim