Brion Vibber [Wed, 23 Dec 2009 04:18:27 +0000 (20:18 -0800)]
Fix for massively slow friends timeline query due to indexing bug introduced with repeats.
Sorting on notice.id when our primary selector was notice_inbox.user_id caused a filesort and table scan of the notice table.
Switchng to notice_inbox's notice_id means we can use our index, and everything comes right up.
Before:
mysql> explain SELECT notice.id AS id FROM notice JOIN notice_inbox ON notice.id = notice_inbox.notice_id WHERE notice_inbox.user_id = 18574 AND notice.repeat_of IS NULL ORDER BY notice.id DESC LIMIT 61 OFFSET 0;
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+----------------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+----------------------------------------------+
| 1 | SIMPLE | notice_inbox | ref | PRIMARY,notice_inbox_notice_id_idx | PRIMARY | 4 | const | 102600 | Using index; Using temporary; Using filesort |
| 1 | SIMPLE | notice | eq_ref | PRIMARY | PRIMARY | 4 | stoica.notice_inbox.notice_id | 1 | Using index |
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+----------------------------------------------+
After:
mysql> explain SELECT notice.id AS id FROM notice JOIN notice_inbox ON notice.id = notice_inbox.notice_id WHERE notice_inbox.user_id = 18574 AND notice.repeat_of IS NULL ORDER BY notice_id DESC LIMIT 61 OFFSET 0;
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+--------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+--------------------------+
| 1 | SIMPLE | notice_inbox | ref | PRIMARY,notice_inbox_notice_id_idx | PRIMARY | 4 | const | 102816 | Using where; Using index |
| 1 | SIMPLE | notice | eq_ref | PRIMARY,notice_repeatof_idx | PRIMARY | 4 | stoica.notice_inbox.notice_id | 1 | Using where |
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+--------------------------+
Brion Vibber [Sat, 19 Dec 2009 19:03:31 +0000 (14:03 -0500)]
Ignore user language settings that aren't listed in language config; we'll then fall back to current autodetection. This prevents the surprises where your profile suddenly switches to Arabic because it was selected by default due to lack of a match in the drop-down box.
Brion Vibber [Sat, 19 Dec 2009 19:03:31 +0000 (14:03 -0500)]
Ignore user language settings that aren't listed in language config; we'll then fall back to current autodetection. This prevents the surprises where your profile suddenly switches to Arabic because it was selected by default due to lack of a match in the drop-down box.
Brion Vibber [Fri, 18 Dec 2009 14:36:30 +0000 (09:36 -0500)]
Followup fix for ticket 1672: Twitter bridge !group->#hash conversion will now happen regardless of whether account was configured with oauth or basic auth (previously applied only on the oauth path)
Brion Vibber [Fri, 18 Dec 2009 14:36:30 +0000 (09:36 -0500)]
Followup fix for ticket 1672: Twitter bridge !group->#hash conversion will now happen regardless of whether account was configured with oauth or basic auth (previously applied only on the oauth path)
Brion Vibber [Tue, 15 Dec 2009 21:53:19 +0000 (13:53 -0800)]
PHP 5.3 closure-based implementation of curry(); old implementation used as fallback for older PHP versions. Added unit tests to confirm they both work!
Brion Vibber [Tue, 15 Dec 2009 00:36:01 +0000 (16:36 -0800)]
Add destructor on Memcached_DataObject to free DB_DataObject's global storage for an object when that object itself is destroyed.
Reduces some, but not all, memory leakage for long-running processes.