Subject Re: Firebird Plan Analyzer
Author Svein Erling Tysvær
Hi Stanislav

> 2. To write my own plan for such big queries (more of them with 10
> filters and more) seems like an absurd

This isn't possible, the query simply cannot use an index when you use
OR <something without an index>. If you want to use the index where
possible, you have to rewrite your procedure to something like

IF (:P_IMPORTID IS NULL)
BEGIN
FOR
SELECT
C.ID
FROM
CONTACTS C
DO
SUSPEND;
END
ELSE
BEGIN
FOR
SELECT
C.ID
FROM
CONTACTS C
WHERE (C.IMPORTID = :P_IMPORTID)
DO
SUSPEND;
END
END;

HTH,
Set