[DATABASE] Add explicit indices for all foreign keys
This adds a requirement for all definitions that have foreign keys to also require indices for all source (local) attributes mentioned in foreign keys. MariaDB/MySQL creates indices for source attributes automatically, so this serves as a way to get rid of those automatic indices and create clean explicit ones instead. In PostgreSQL, most of the time, indices on the source are necessary to decrease performance penalty of foreign keys (like in MariaDB), but they aren't created automatically, so this serves to remove that difference between PostgreSQL and MariaDB.
This commit is contained in:
@@ -90,6 +90,7 @@ class ModLog extends Managed_DataObject
|
||||
],
|
||||
'indexes' => [
|
||||
'modlog_profile_id_created_idx' => ['profile_id', 'created'],
|
||||
'modlog_moderator_id_idx' => ['moderator_id'],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
Reference in New Issue
Block a user