Forums / Setup & design / Poor search performance

Poor search performance

Author Message

Roberto Moreda Álvarez

Thursday 12 June 2003 7:39:16 pm

Hi.

I'm trying ezpublish 3.1.0-2 with mysql-4.0.12, php-4.2.3 and apache 1.3.27. If I use the search facility (from admin design, by exmaple) looking for "the thing" (including the quotation marks) the mysql-server gets a very high load for a long time...

Any obvious optimization hints?

Bård Farstad

Thursday 12 June 2003 11:26:20 pm

How big is your database? Normally the search should be very fast.

--bård

Documentation: http://ez.no/doc

Roberto Moreda Álvarez

Friday 13 June 2003 2:56:05 am

Need more testing... The problem is narrowed to searchs where one word have latin1 characters like "ñ" (it works with other like "áéíóú").
In case of a single word with "ñ" the search result is always 0, and in case of "the thingñ" the mysql thread simply hangs using 100% of cpu.

Bård Farstad

Friday 13 June 2003 3:28:14 am

Please let us know what you find. I know there are some problems with those characters, but I haven't seen a performance impact because of it.

--bård

Documentation: http://ez.no/doc

Roberto Moreda Álvarez

Saturday 14 June 2003 4:04:31 pm

Hi!
Two findings about my problems with search:

- The performance problem it's related to a incorrect join planification in mysql under certain circunstances. In ezsearchengine.php, the SELECT JOINs, when we populate the temporary table, are executed in a suboptimal order. To overcome this I have rewrited the SQL sentences using "LEFT JOIN" constructs to force a join order execution. This solved the problem. Now the searches are fast as expected.

- The problem related with the search of words with latin1 characters are due to the mysql treatment of string comparison. This leads to situations where "españa" is equal to "espana" for mysql :-(. This is a problem with words that have different meaning depending on a "ñ" or "n" character...
The solution is to declare the phrase and word fields as "BINARY" in mysql creation tables.

I have a patch for both cases. If it can be useful I'll send it to some email address.
Regards.

Rober

Jerry Jalava

Wednesday 18 June 2003 2:16:20 am

Hola Roberto!

Could you send this patch to Contributions area? I need it for this portal that is coming up... It's Finnish/Spanish/Swedish, so I need the special characters to work in search...

Regards,
Jerry

eZ debug

Timing: Jan 18 2025 04:20:28
Script start
Timing: Jan 18 2025 04:20:28
Module start 'content'
Timing: Jan 18 2025 04:20:28
Module end 'content'
Timing: Jan 18 2025 04:20:29
Script end

Main resources:

Total runtime0.9204 sec
Peak memory usage4,096.0000 KB
Database Queries205

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0081 587.7031180.8438
Module start 'content' 0.00810.7705 768.5469606.9531
Module end 'content' 0.77860.1417 1,375.5000337.0703
Script end 0.9203  1,712.5703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.4469210.0002
Check MTime0.00160.1701210.0001
Mysql Total
Database connection0.00120.127110.0012
Mysqli_queries0.841491.41952050.0041
Looping result0.00230.25102030.0000
Template Total0.888496.520.4442
Template load0.00200.216420.0010
Template processing0.886496.306920.4432
Template load and register function0.00020.016610.0002
states
state_id_array0.00140.156910.0014
state_identifier_array0.00220.241220.0011
Override
Cache load0.00170.1815320.0001
Sytem overhead
Fetch class attribute can translate value0.00180.197440.0005
Fetch class attribute name0.00170.185670.0002
XML
Image XML parsing0.00130.142040.0003
class_abstraction
Instantiating content class attribute0.00000.002380.0000
General
dbfile0.00230.2551280.0001
String conversion0.00000.000830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs