Avoid ordering just by a timestamp

Try to also employ an id when possible.
Involves reworking some of the indices.
This commit is contained in:
Alexei Sorokin
2020-09-15 16:59:27 +03:00
committed by Diogo Peralta Cordeiro
parent ae4f3176b1
commit a0f72fe5c6
41 changed files with 633 additions and 656 deletions

View File

@@ -82,11 +82,8 @@ class Message extends Managed_DataObject
'message_to_profile_fkey' => array('profile', array('to_profile' => 'id')),
),
'indexes' => array(
// @fixme these are really terrible indexes, since you can only sort on one of them at a time.
// looks like we really need a (to_profile, created) for inbox and a (from_profile, created) for outbox
'message_from_profile_idx' => array('from_profile'),
'message_to_profile_idx' => array('to_profile'),
'message_created_idx' => array('created'),
'message_from_profile_created_id_idx' => array('from_profile', 'created', 'id'),
'message_to_profile_created_id_idx' => array('to_profile', 'created', 'id'),
),
);
}