Forums / Install & configuration / MySQL problems in Windows

MySQL problems in Windows

Author Message

Jo Henrik Endrerud

Tuesday 23 June 2009 2:30:28 pm

I'm having some very slow queries on a windows setup. It's especially one query that's slow, and unfortunately it's one of the very important ones that's used all over in eZ Publish:

SELECT id, contentobject_id, version, language_code, language_id, contentclassattribute_id, attribute_original_id, sort_key_int, sort_key_string, data_type_string, data_text, data_int, data_float FROM ezcontentobject_attribute WHERE contentclassattribute_id='232' AND contentobject_id='5128' AND version='30' order by id desc;
(applies to all ID's)

The query takes more than 2 seconds each time. All indexes in the database is set correctly.
If I try the query in the mysql console it's just as slow, but everything speeds up if I remove the "order by id desc" part of the query. It's also very fast if I try to sort on another field in the table.

The server is a very powerful server, but I'm not that experienced on configuring Windows so it might be related to this. I've tried to change the "normal" settings like key_buffer_size, sort_buffer_size and so on, but nothing helps.

The table has about 800.000 records.

Any Windows gurus with any suggestions?

Jo Henrik Endrerud | System Developer @ Seeds Consulting | http://www.seeds.no

Gaetano Giunta

Wednesday 24 June 2009 1:18:46 am

Could you send an explain_plan of that query?

If installing perl+[cygwin or unxutils] is ok with you, I can send a patched version of the mysqltuner.pl perl script that works on windows and can easily give you some tips about mysql configuration

Principal Consultant International Business
Member of the Community Project Board

Jo Henrik Endrerud

Wednesday 24 June 2009 8:52:37 am

Hi. Explain on the query is as follows:

explain SELECT id, contentobject_id, version, language_code, language_id, contentclassattribute_id, attribute_original_id, sort_key_int, sort_key_string, data_type_string, data_text, data_int, data_float FROM ezcontentobject_attribute WHERE contentclassattribute_id='232' AND contentobject_id='5128' AND version='30' order by id desc;
+----+-------------+---------------------------+-------+------------------------------------------------------------------------------------------+---------+---------+------+---------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+---------------------------+-------+------------------------------------------------------------------------------------------+---------+---------+------+---------+-------------+
| 1 | SIMPLE | ezcontentobject_attribute | index | ezcontentobject_attribute_co_id_ver_lang_code,ezcontentobject_attribute_contentobject_id | PRIMARY | 8 | NULL | 1016061 | Using where |
+----+-------------+---------------------------+-------+------------------------------------------------------------------------------------------+---------+---------+------+---------+-------------+
1 row in set (0.00 sec)

Do you have any suggestions based on this?

I won't mind trying out the mysqltuner if thats the only option i have.

Jo Henrik Endrerud | System Developer @ Seeds Consulting | http://www.seeds.no

eZ debug

Timing: Jan 30 2025 20:30:36
Script start
Timing: Jan 30 2025 20:30:36
Module start 'content'
Timing: Jan 30 2025 20:30:36
Module end 'content'
Timing: Jan 30 2025 20:30:37
Script end

Main resources:

Total runtime0.6151 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0081 587.9531370.2891
Module start 'content' 0.00810.0280 958.24221,005.5469
Module end 'content' 0.03610.5790 1,963.78913,894.9688
Script end 0.6151  5,858.7578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.01242.0136200.0006
Check MTime0.00120.1983200.0001
Mysql Total
Database connection0.00040.063910.0004
Mysqli_queries0.367159.67521410.0026
Looping result0.00230.37411390.0000
Template Total0.578694.110.5786
Template load0.00070.117710.0007
Template processing0.577993.941210.5779
Override
Cache load0.00050.077410.0005
Sytem overhead
Fetch class attribute can translate value0.00330.532210.0033
XML
Image XML parsing0.00030.040710.0003
General
dbfile0.03085.0113200.0015
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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs