koha-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Koha-devel] query optimization


From: Chris Cormack
Subject: Re: [Koha-devel] query optimization
Date: Tue May 14 02:42:03 2002

On Tue, 2002-05-14 at 21:28, paul POULAIN wrote:
> Many queries are build with :
> 
> (title like '$key[0]%' or title like '% $key[0]%')
> 
> I was wondering why :
> * title like '$key%' is index optimizable
> * title like '% $key%' is NOT index optimizable.
> 
> optimizable OR not optimizable === NOT optimizable.
> 
> So the resulting query is not optimizable.
> 
> So, what's the interest of such a string, as "title like '%'.$key.'%'" 
> has the same result ?

If title like '%'.$key.'%'" does the same thing and is optimisable then
we should use that.
What the above is trying to do is find the word if its at the start of
the title, or is another word thats part of the title.
For eg if we are searching for 'host'
we want it to find titles such as 'Host of stuff' and 'Here come the
hosts'

We dont want to find 'ghosts'  Ie we only want wildcarding off the end
of each word. Not the front.

I hope this makes sense.

If your above construct can do this, that would be great :)

Chris
-- 
Chris Cormack                                      address@hidden
Programmer                                                025 500 579
Katipo Communications                                www.katipo.co.nz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]