Subject Re: [firebird-support] Optimization help: is null and not null?
Author Vitali Voroth
You might want to add indices on the columns
STATUS, HANDLED_TIMESTAMP and RECEIPT_TIMESTAMP

Am 31.03.2014, 13:26 Uhr, schrieb Harriv <harriv@...>:

> Hi,
>
> 3rd party application is doing following query:
>
> SELECT
> *
> FROM
> V_MY_VIEW
> WHERE
> V_MY_VIEW.HANDLED_TIMESTAMP IS NOT NULL AND
> V_MY_VIEW.RECEIPT_TIMESTAMP IS NULL
>
> V_MY_VIEW is simple view with:
>
> SELECT
> *
> FROM
> MY_TABLE
> WHERE
> STATUS > 0
> .
>
> This query doesn't return many rows (if any), but it takes a long time to
> run. Is there a way to optimize this?
>
> I'm running Firebird 2.5.2