Subject Re: Firebird Plan Analyzer
Author Svein Erling Tysvær
--- In firebird-support@yahoogroups.com, "kick_tisho" wrote:
> 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

To me, that seems like a bad way to force the use of an index. My
guess is that this will be way slower than using no index at all.

Sorry,
Set