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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 00:18:59
Script start
Timing: Jan 31 2025 00:18:59
Module start 'layout'
Timing: Jan 31 2025 00:18:59
Module start 'content'
Timing: Jan 31 2025 00:19:00
Module end 'content'
Timing: Jan 31 2025 00:19:00
Script end

Main resources:

Total runtime0.9896 sec
Peak memory usage8,192.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 588.2344151.2109
Module start 'layout' 0.00470.0041 739.4453220.6875
Module start 'content' 0.00880.9800 960.13284,449.7422
Module end 'content' 0.98880.0008 5,409.875011.8516
Script end 0.9896  5,421.7266 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.3502160.0002
Check MTime0.00130.1338160.0001
Mysql Total
Database connection0.00060.058710.0006
Mysqli_queries0.908291.7795570.0159
Looping result0.00060.0568550.0000
Template Total0.937194.720.4685
Template load0.00220.217620.0011
Template processing0.934994.473220.4675
Template load and register function0.00140.145410.0014
states
state_id_array0.00170.176810.0017
state_identifier_array0.00110.114620.0006
Override
Cache load0.00180.1836260.0001
Sytem overhead
Fetch class attribute can translate value0.00200.205120.0010
Fetch class attribute name0.00230.228940.0006
XML
Image XML parsing0.00070.075120.0004
class_abstraction
Instantiating content class attribute0.00000.001440.0000
General
dbfile0.00230.2321160.0001
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs