Subject RE: [firebird-support] Best index for BETWEEN?
Author Mercea Paul
>From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Milan Babuskov
>Sent: Wednesday, October 15, 2008 19:31
>To: firebird-support@yahoogroups.com
>Subject: [firebird-support] Best index for BETWEEN?

>Hi,

>In an application I'm currently developing I have a lot of parametrized
>queries like this:

>SELECT * FROM table1 t WHERE :somevalue BETWEEN t.field1 AND t.field2;

Are you sure about this select?
For me looks more logic something like:

SELECT * FROM table1 t WHERE t.id_or_date BETWEEN :param1 AND :param2;

And this guide me to make index on t.id_or_date field .

Regards,
Paul