Forums / Developer / Ez 3.8.X doesn't work with big database

Ez 3.8.X doesn't work with big database

Author Message

luis muñoz

Thursday 28 September 2006 9:41:42 am

Hi all,

I've tryed installing all 3.8 ez from 3.8.0 to 3.8.4 but i alwais get the same result:
Everything works without errors but page load time ridiculous, sometimes even timeout. I found the cause is a mysql query:

SELECT ezcontentobject.*,
ezcontentobject_tree.*,
ezcontentclass.name as class_name,
ezcontentclass.identifier as class_identifier,
ezcontentobject_name.name as name,  ezcontentobject_name.real_translation
FROM
ezcontentobject_tree,
ezcontentobject,ezcontentclass, 
ezcontentobject_name
WHERE
path_string like '/1/2/10570/%' and  depth = 3  and
ezcontentclass.version=0 AND
ezcontentobject_tree.contentobject_id = ezcontentobject.id  AND
ezcontentclass.id = ezcontentobject.contentclass_id AND
ezcontentobject_tree.contentobject_id = ezcontentobject_name.contentobject_id and
ezcontentobject_tree.contentobject_version = ezcontentobject_name.content_version and
( ezcontentobject_name.language_id & ezcontentobject.language_mask > 0 AND
 ( (   ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 1 )
+ ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 16 ) >> 3 )
+ ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 8 ) >> 1 )
+ ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 256 ) >> 5 )
+ ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 128 ) >> 3 )
+ ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 64 ) >> 1 )
+ ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 4 ) << 4 )
+ ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 2 ) << 6 )
+ ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 32 ) << 3 )
<
( ezcontentobject_name.language_id & 1 )
+ ( ( ezcontentobject_name.language_id & 16 ) >> 3 )
+ ( ( ezcontentobject_name.language_id & 8 ) >> 1 )
+ ( ( ezcontentobject_name.language_id & 256 ) >> 5 )
+ ( ( ezcontentobject_name.language_id & 128 ) >> 3 )
+ ( ( ezcontentobject_name.language_id & 64 ) >> 1 )
+ ( ( ezcontentobject_name.language_id & 4 ) << 4 )
+ ( ( ezcontentobject_name.language_id & 2 ) << 6 )
+ ( ( ezcontentobject_name.language_id & 32 ) << 3 )
)
AND ezcontentobject_tree.is_invisible = 0
AND ((ezcontentobject.contentclass_id in (1, 11, 12, 19, 2, 20, 21, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 48, 49, 5, 50) AND ezcontentobject.section_id in (1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 3, 7, 8, 9)) OR (ezcontentobject.contentclass_id in (1, 11, 19, 2, 20, 21, 32, 34, 35, 36, 37, 38, 39, 4, 40, 41, 42, 43, 44, 46, 48, 49, 5, 50) AND ezcontentobject.section_id in (1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 3, 7, 9)) OR (ezcontentobject.contentclass_id in (1, 16, 19, 2, 20, 21, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44) AND ezcontentobject.section_id in (1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 7, 9)))
AND
ezcontentobject.language_mask & 511 > 0
ORDER BY  path_string ASC

Is it possible to make a less heavy query or any other thing? With a big database the site becomes unusable.

Thanks

Björn Dieding@xrow.de

Thursday 28 September 2006 10:58:45 am

About how many content objects are you talking about? How big is big?

Is this some query from the backend? It seems somehow that this one is triggered through a custom fetch( content, tree )

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

luis muñoz

Friday 29 September 2006 4:28:00 am

Thanks for the answer,

It happends on my code and also on admin code. I have about 200k objects.

With sql debug on i found that all the slow queries (the ones witch takes more than 1 sec to execute) has a where like

path_string like '/1/2/1297/%' and  depth = 3  and 

Not always '=' , also '>=', '<=' and not the same depth but always the same where.

Not all the queries with this where go to "Copying to tmp table" status, probably because of the query cache or any other mysql cache.

Any help would be apreciated

Luis

Björn Dieding@xrow.de

Friday 29 September 2006 4:46:28 am

Doh this is big...

I think you should inform eZ about your troubles... 1 sec is just too long

Have you yet looked into fine tuning your db/mysql? There was an article released lately.

maybe you can make the query cache really high....

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

luis muñoz

Friday 29 September 2006 5:03:17 am

Hi,

I tuned database yesterday following the indications on http://ez.no/community/articles/tuning_mysql_for_ez_publish but that didn't fix the problem.
I think the problem comes from using the operator like with a string with wildcards, i'll check with mysql forums. I'm also looking if it performs better changing the order of the where.
Should i post it as a bug? sugestion?

Thanks

Björn Dieding@xrow.de

Friday 29 September 2006 5:15:17 am

Yes i would post a bug, if it doesn't exsit yet.

Also I am pretty sure eZ is aware about this... expressing the need of solving this doesn't hurt.

No further suggestions... sorry...

We can only hope telemark can scale to any limit of objects

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Kåre Køhler Høvik

Friday 29 September 2006 5:49:19 am

Hi

I've added a bug report about this. Please see: http://ez.no/bugs/view/9091
You can try the index I've listed there, and see if they improve the performance.

Best regards
Kåre

Kåre Høvik

luis muñoz

Friday 29 September 2006 7:23:20 am

Indexes really worked. There are two sqls wich throw errors:

mysql> create index ezurlalias_is_wildcard on ezurlalias( is_wildcard );
ERROR 1061 (42000): Duplicate key name 'ezurlalias_is_wildcard'

mysql> create index eznode_assignment_is_main on eznode_assignment( is_main );
ERROR 1061 (42000): Duplicate key name 'eznode_assignment_is_main'

Thanks,
Luis

Marco Zinn

Saturday 30 September 2006 2:17:48 am

Kore, thanks for posting the new indexes. We applied them as well ;)
Just a note: Can you have a look at the ezcontentobject.language_mask comparisons in the WHEREs, so this could be optimized for single lingual sites?

Marco
http://www.hyperroad-design.com

eZ debug

Timing: Jan 31 2025 01:26:39
Script start
Timing: Jan 31 2025 01:26:39
Module start 'content'
Timing: Jan 31 2025 01:26:39
Module end 'content'
Timing: Jan 31 2025 01:26:39
Script end

Main resources:

Total runtime0.2031 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.0072 588.0469370.2891
Module start 'content' 0.00730.0152 958.33591,013.6719
Module end 'content' 0.02250.1806 1,972.00783,908.9922
Script end 0.2031  5,881.0000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00502.4599200.0002
Check MTime0.00140.7034200.0001
Mysql Total
Database connection0.00080.395310.0008
Mysqli_queries0.101850.13741410.0007
Looping result0.00140.68751390.0000
Template Total0.180188.710.1801
Template load0.00090.452510.0009
Template processing0.179288.201010.1792
Override
Cache load0.00070.327410.0007
Sytem overhead
Fetch class attribute can translate value0.00221.083010.0022
XML
Image XML parsing0.00030.136410.0003
General
dbfile0.00763.7548200.0004
String conversion0.00000.002930.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