Hi. I have some views that use multistep fields in them. The queries take a long time to run because the columns of the multistep table are not indexed.

I have a patch to the .install file that will add the indexes. My queries went from 80 seconds to 0.53 seconds.

CommentFileSizeAuthor
#1 multistep-824406.patch1.39 KBvkareh
multistep.indexes.patch1.21 KBgalaxor

Comments

vkareh’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new1.39 KB

Thanks for the patch!

I started looking at the indexing, and I'm concerned it will affect I/O operations and disk space, so I came up with a few possible changes:

  • Indexing the step column by itself provides no real gain, since you never query for that on its own. Instead, I combined it with the nid column, so that you can still get indexing, while taking advantage of MySQL's leftmost prefixing and avoid creating unnecessary indexes.
  • The status index can be really cut down to just 1 character, since there are really only two options for that column: either submitted or unsubmitted.

I also added nid-step as a primary key, for what that's worth...

Can you please try the new patch and let me know if you see similar performance gains?

vkareh’s picture

Status: Needs review » Fixed

I added this to the new development snapshot. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.