[NodeInfo][DATABASE] Adjust indices of the "notice" and "user" tables
On big databases these queries from the Nodeinfo plugin choked up: SELECT profile_id FROM notice WHERE notice.created >= (CURRENT_DATE - INTERVAL '180' DAY) AND notice.is_local = 1; SELECT id FROM "user" WHERE "user".created >= (CURRENT_DATE - INTERVAL '180' DAY);
This commit is contained in:
parent
fbc6fe0818
commit
53af27a303
@ -107,6 +107,7 @@ class Notice extends Managed_DataObject
|
||||
'indexes' => array(
|
||||
'notice_created_id_is_local_idx' => array('created', 'id', 'is_local'),
|
||||
'notice_profile_id_idx' => array('profile_id', 'created', 'id'),
|
||||
'notice_is_local_created_profile_id_idx' => array('is_local', 'created', 'profile_id'),
|
||||
'notice_repeat_of_created_id_idx' => array('repeat_of', 'created', 'id'),
|
||||
'notice_conversation_created_id_idx' => array('conversation', 'created', 'id'),
|
||||
'notice_object_type_idx' => array('object_type'),
|
||||
|
@ -102,6 +102,7 @@ class User extends Managed_DataObject
|
||||
'user_carrier_fkey' => array('sms_carrier', array('carrier' => 'id')),
|
||||
),
|
||||
'indexes' => array(
|
||||
'user_created_idx' => array('created'),
|
||||
'user_smsemail_idx' => array('smsemail'),
|
||||
),
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user