Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This was taking >600ms because it can't use the full index.
Comment | File | Size | Author |
---|---|---|---|
#17 | panelizer-n1637304-17.patch | 2.13 KB | DamienMcKenna |
|
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted and pushed to both branches.
Comment #3
japerryOn large sites, this query is still not very performant. Working with Drumm, it appears that this original patch is flawed here, and instead an index to revision_id should be added.
Some results below with MYSQL explain and index.
Without an index, the original code. Notice that it returns more rows on a large site. (which is probably why the query is slow)
After the original code patch/commit in this issue. key_len is slightly longer due to fulltext search of the entity_type and union of the referenced primary keys. However, it is returning 1 row, which is expected and will be faster than the first query.
These next two are like the ones above, but after adding a new index called revision which puts together revision_id and entity_type. Not much of a performance/calls change vs the current patch.
Change the revision index to just use revision_id. Much shorter key_len and in theory this should be faster.
And looking at the current code, we should revert back to the original code, because it is faster with the index.
Comment #4
japerryRemoving the original query this issue fixed. This includes the patch in #3
Comment #5
japerryComment #8
japerryThis is failing due to the fact that our patch relies on #2457113: Better Revision Handling inside and outside of Workbench Moderation
Comment #9
drummComment #11
Steven Jones CreditAttribution: Steven Jones at ComputerMinds commentedHere's a patch for dev that should work.
Comment #12
DamienMcKennaComment #13
DamienMcKennaThe patch will need to be rerolled as panelizer_schema() was rewritten.
Comment #14
DamienMcKennaComment #15
DamienMcKennaRerolled.
Comment #17
DamienMcKennaDuh, Damien.
Comment #19
DamienMcKennaCommitted. Thanks!