Subject Re: Firebird Plan Analyzer
Author kick_tisho
One friend just propose me something

IF (:P_IMPORTID IS NULL) THEN P_IMPORTID = 0;

FOR
SELECT
P.ID
FROM PERSONS p
WHERE
(:P_IMPORTID > 0 AND P.IMPORTID = :P_IMPORTID)
or (:P_IMPORTID = 0 AND P.ID > 0)
INTO :PERSONID
DO
SUSPEND;


now it uses the importid index, but and the PK index