koha-devel
[Top][All Lists]
Advanced

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

Re: [Koha-devel] query optimization


From: paul POULAIN
Subject: Re: [Koha-devel] query optimization
Date: Tue May 14 03:43:03 2002
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020313

Chris Cormack wrote:
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.
NO query containing "like %something" may be optimized.   This one is not optimizable.
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.
OK, good explanation. My construct can't differentiate  this.
If your above construct can do this, that would be great :)
Forget my proposal.


reply via email to

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