Subject Re: [firebird-support] Query help needed
Author Svein Erling Tysvaer
If Firebird 1.5 reports a plan for ORDERing, it doesn't report the
underlying plan for the WHERE part. It still uses the index for the
unique constraint, but you need to use Firebird 2.0 to actually be able
to see that it does so.

Set

Rick Debay wrote:
> SELECT FIRST 1
> *
> FROM
> MY_TABLE t1
> WHERE
> t1.UNIQUE_CONSTRAINTS = ? AND
> t1.V1 < :GIVEN_NUMBER
> ORDER BY
> t1.V1 DESC
>
> Strangely, this query doesn't use the unique constraint in its plan:
>
> PLAN (T1 ORDER I_V1_INDEX)