Subject Re: SQL Performance help
Author Adam
--- In firebird-support@yahoogroups.com, Robert martin <rob@...> wrote:
>
> Hi
>
> Thanks Adam. Yes the IN clause is the bottleneck. I have just
solved ?
> the issue by creating a stored procedure that handles the IN part so my
> 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.
>


> The only downside (apart from shear ugliness) is that it limits our
code
> to up to 10 search words.

Don't you wish there was an edit button sometimes.

Another possibility is if you parse your title within the stored
procedure. This will help in that end:

http://www.fbtalk.net/viewtopic.php?id=238

You would then change your stored procedure to contain a single input
parameter (up to 32K, depends on your needs).

From inside your stored procedure, you would do something like:

SELECT DISTINCT OPTEXT
FROM SPLITTEXT(:BookTitle, ' ', '-, ''')
INTO :AWORD

This would allow you effectively an unlimited number of search words.

Adam