Share » Forums » Install & configuration » huge queries hanging on DB - how to...

huge queries hanging on DB - how to troubleshoot?

huge queries hanging on DB - how to troubleshoot?

Friday 15 September 2006 6:03:29 am - 4 replies

Author Message

Massimiliano Bariola

Friday 15 September 2006 7:27:46 am

Seems I have found what it is. some user was entering search strings made of a sentence with 40 words and eZpublish created one tmp table per each word.

Solution: I limited the number of different words to 8 and for the time being I see no more hung queries.

Suggestion to eZ: a new config option to set maximum number of words in search string so that there will be no need to cope for it in template code.

Carlos Revillo

Tuesday 22 January 2008 5:34:51 am

hello. I know this is a very old post, but i think this is exactly the issue we have...
How do you limited the number of different words to search? I'm looking at the documentation with no luck...
I know i could try to edit the php files, but i'd prefer to leave ez kernel as it was.

Thank you.

Massimiliano Bariola

Wednesday 23 January 2008 2:45:51 am

Hi Carlos,

at the time I solved it by developing a simple extension (you don't really need it; you can use an override template) which did a fetch - search. the text to be searched was limited in number of words via template code.

it goes like this:

{set $text = $text|explode(' ')|extract_left(8)|implode(' ')}

this way, I only take the first 8 words.

then I do my search like this:

{def $resultsArray = fetch(content, search, hash(text, $text))}

Of course you can finetune the search fetch with all the needed optional parameters.

There had been talk from eZ to implement a maximum word count ini setting, but last time I checked - a year ago - there wasn't any yet.

HTH,

Massimiliano

Carlos Revillo

Wednesday 23 January 2008 12:44:30 pm

Hi again. Thanks for your reply. i have "overriden" content/search template and limited the search to only eight words. all is ok now. i've got some located search phrases wich made mysql shows a process with statistics status for a long time (the more words, the more it took).

But i still i have some doubts about all this. we also have other search phrases longer than those who makes mysql server crazy, and this longer phrases doesn't have any problem. search results was presented in seconds.

The other thing it would like to note, is that this "problematic" phrases doesn't give any problem with mysql 5. i have tested the same installation, same database and diferent mysql servers.
so... maybe is a mysql 4 related issue...

btw. it would be nice that configuration setting to limit these phrases. thanks again for your time.

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu