Subject | Re: Firebird Plan Analyzer |
---|---|
Author | kick_tisho |
Post date | 2005-05-13T13:03:58Z |
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
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