Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Because {node}.language is used in the WHERE clause to generate the pager list on ?q=admin/content, the lack of index on the language column makes the query slower than it needs to be.
Comment | File | Size | Author |
---|---|---|---|
#22 | 813634-node-language-index-22.patch | 720 bytes | cafuego |
#18 | add-node-language-index-813634-18.patch | 1.41 KB | Nitesh Sethia |
#16 | add-node-language-index-813634-16.patch | 489 bytes | jlscott |
#16 | interdiff-813634-16.txt | 540 bytes | jlscott |
#11 | 813634-add-node-language-index-11.patch | 489 bytes | jlscott |
Comments
Comment #1
cafuego CreditAttribution: cafuego commentedAttached patch adds an index in node.install and implements node_update_7011() to add the index on existing installations. See #778050: Add support for database hints and make PagerDefault properly pluggeable for a link to query speed tests.
Comment #2
cafuego CreditAttribution: cafuego commentedComment #3
brianV CreditAttribution: brianV commentedPatch attached for D8, and a reroll for D7.
Schema change only in D8, schema change and hook_update_n() in D7.
Comment #4
larowlanWe also need an update hook to add the index for existing installs.
Comment #5
brianV CreditAttribution: brianV commentedThere are two patches in #3. One for D8 which is just the schema change, and one for D7 that has schema change and update hook.
No update hook is needed in D8 since HEAD->HEAD upgrades are currently not supported.
Comment #6
YesCT CreditAttribution: YesCT commented#3: 813634-add-node-language-index.patch queued for re-testing.
Comment #8
claudinec CreditAttribution: claudinec commentedRerolled new patch for D8 schema change.
Comment #9
claudinec CreditAttribution: claudinec commentedComment #11
jlscott CreditAttribution: jlscott commentedThe previous patch used the column name "language" instead of "langcode". Patch has been rerolled to include the correct column name.
Comment #12
cafuego CreditAttribution: cafuego commentedLooks good to me.
Comment #13
YesCT CreditAttribution: YesCT commentedmaybe someone from d8mi can chime in here to rtbc it.
I dont see anything wrong, but I'm not knowledgable about performance and such.
Comment #14
YesCT CreditAttribution: YesCT commentedtag didn't stick.
Comment #15
Deciphered CreditAttribution: Deciphered commentedIf at all possible, can we get an interdiff for this to make the review process a little easier?
Comment #16
jlscott CreditAttribution: jlscott commentedSorry for the delay, but I have now rerolled the patch and created an interdiff as requested.
This patch is so simple that the interdiff is actually larger than the patch :)
Comment #17
jair CreditAttribution: jair commentedNeeds reroll
Comment #18
Nitesh Sethia CreditAttribution: Nitesh Sethia commentedRerolling the patch #16
Comment #20
wesleydv CreditAttribution: wesleydv commentedInvestigated this and the patch is no longer needed because current D8 head already has:
So I believe this patch is no longer needed.
Comment #21
Sutharsan CreditAttribution: Sutharsan commentedI agree, 'language' already has an index.. A bit more verbose:
In node.install you find:
$schema['node_field_revision'] = array(
'description' => 'Stores information about each saved version of a {node}.',
'fields' => array(
...
'indexes' => array(
'nid' => array('nid'),
'uid' => array('uid'),
'revision_uid' => array('revision_uid'),
'vid' => array('vid'),
'node_default_langcode' => array('default_langcode'),
'node_langcode' => array('langcode'),
),
...
'primary key' => array('nid', 'vid', 'langcode'),
);
Comment #22
cafuego CreditAttribution: cafuego commentedRe-opening for 7.x-dev because it's still not fixed in D7, which is where I wanted it fixed to begin with :-P Re-attached an updated for-git version of the original patch from comment 1.
Comment #23
wesleydv CreditAttribution: wesleydv commentedLooks ok to me
Comment #24
Anonymous (not verified) CreditAttribution: Anonymous commentedthis is for David to look at now.
Comment #25
David_Rothstein CreditAttribution: David_Rothstein commentedCommitted to 7.x - thanks! http://drupalcode.org/project/drupal.git/commit/cc20016
Comment #26
David_Rothstein CreditAttribution: David_Rothstein commented