SQL indices improvement

You need to be logged in to post messages in the forums. New users may register here.

Eugene Svirskyy

Member since:
16 August 2008

Posts: 8

Tuesday 07 April 2009 4:23:17 am

In order to speed up SQL-queries that are executed in survey/result view it'll be nice to create some indices that are absent for some reason. The following indices reduce execution time of SELECT-queries related to survey up to 1000-10000 times :-)

For MySQL:

































































Up

Bjørn Reiten

Member since:
22 February 2008

Posts: 35

Wednesday 08 April 2009 2:50:08 am

Great :-)

I've added the indexes to svn, trunk rev. 64. From what I can see, the index ezcontentobject_attribute_version is already existing in eZ Publish as standard.
Up

Eugene Svirskyy

Member since:
16 August 2008

Posts: 8

Wednesday 08 April 2009 7:35:16 am

Just have checked ezpublish-4.1.0 available for download and it doesn't have a separate index for ezcontentobject_attribute.version field.
version field is used in two compound indices for ezcontentobject_attribute table but none of them can be used in survey queries :( So this additional index is very important if we are interested in reducing time of query execution ;-)
Up

Bjørn Reiten

Member since:
22 February 2008

Posts: 35

Wednesday 15 April 2009 6:08:19 am

Just did some more testing. Which query did you test, on which page?

From what I could see, testing with mysql this should also be ok:














































Up

You need to be logged in to post messages in the forums. New users may register here.