Ejegg has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/364783 )
Change subject: Speed up thank you query ...................................................................... Speed up thank you query Ordering by ID ascending is taking up to 9 seconds on production. Changing the sort to use receive_date make the query take less than 1 second, and keeps us thanking people in the right order. Change-Id: Icbfa48febb98c2752f41046897350c85db9f2193 --- M sites/all/modules/thank_you/thank_you.module 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/83/364783/1 diff --git a/sites/all/modules/thank_you/thank_you.module b/sites/all/modules/thank_you/thank_you.module index 58e672c..918401e 100644 --- a/sites/all/modules/thank_you/thank_you.module +++ b/sites/all/modules/thank_you/thank_you.module @@ -754,7 +754,7 @@ receive_date > DATE_SUB( NOW(), INTERVAL :interval DAY ) AND thankyou_date IS NULL AND no_thank_you IS NULL - ORDER BY id ASC LIMIT {$batch}; + ORDER BY receive_date ASC LIMIT {$batch}; EOT; $result = db_query( $ty_query, array( ':interval' => $days ) ); -- To view, visit https://gerrit.wikimedia.org/r/364783 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icbfa48febb98c2752f41046897350c85db9f2193 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: Ejegg <ej...@ejegg.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits