Subject | Re: SQL Performance help |
---|---|
Author | Adam |
Post date | 2006-11-05T23:51:48Z |
--- In firebird-support@yahoogroups.com, Robert martin <rob@...> wrote:
from possibly occurring.
SELECT bk.ISBN13, bk.FTI
FROM Pr_BookWordAndSearch('WET', 'WILD', NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL) p
LEFT JOIN Book bk ON p.ISBN13 = bk.ISBN13
WHERE BK.ISBN13 IS NOT NULL;
That will ensure the join order starts with the stored procedure.
check is whether your statistics are up to date, but considering the
|| '' did nothing to improve things, I doubt it is statistics.
Adam
>solved ?
> Hi
>
> Thanks Adam. Yes the IN clause is the bottleneck. I have just
> the issue by creating a stored procedure that handles the IN part so myI would make a minor change to prevent a 'no current record' exception
> query now looks like...
>
>
> SELECT bk.ISBN13, bk.FTI
> FROM Book bk
> JOIN Pr_BookWordAndSearch('WET', 'WILD', NULL, NULL, NULL, NULL, NULL,
> NULL, NULL, NULL) p ON p.ISBN13 = bk.ISBN13
>
>
> This produces records in .1 < ms and should work great.
from possibly occurring.
SELECT bk.ISBN13, bk.FTI
FROM Pr_BookWordAndSearch('WET', 'WILD', NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL) p
LEFT JOIN Book bk ON p.ISBN13 = bk.ISBN13
WHERE BK.ISBN13 IS NOT NULL;
That will ensure the join order starts with the stored procedure.
> p.s. your solution query didn't improve the situation.I was really doubtful it would. The only other thing you may want to
check is whether your statistics are up to date, but considering the
|| '' did nothing to improve things, I doubt it is statistics.
Adam