Subject | Re: Firebird Plan Analyzer |
---|---|
Author | Svein Erling Tysvær |
Post date | 2005-05-13T10:48:19Z |
Hi Stanislav
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
> 2. To write my own plan for such big queries (more of them with 10This isn't possible, the query simply cannot use an index when you use
> filters and more) seems like an absurd
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