Split indexes for history table to have either id or __id
815a0a887c3e added the index but the id and __id are just included to the index when the pre-filtering could be improved if id was in the index and the window order could be improved if the __id was in the index.
This commit is contained in:
@@ -370,14 +370,22 @@ class ModelSQL(ModelStorage):
|
||||
(history_table.id, Index.Equality())),
|
||||
Index(
|
||||
history_table,
|
||||
(history_table.id, Index.Equality()),
|
||||
(Coalesce(
|
||||
history_table.write_date,
|
||||
history_table.create_date),
|
||||
Index.Range()),
|
||||
order='DESC',
|
||||
include=[
|
||||
Column(history_table, '__id'),
|
||||
history_table.id]),
|
||||
include=[Column(history_table, '__id')]),
|
||||
Index(
|
||||
history_table,
|
||||
(Coalesce(
|
||||
history_table.write_date,
|
||||
history_table.create_date),
|
||||
Index.Range()),
|
||||
(Column(history_table, '__id'), Index.Range()),
|
||||
order='DESC',
|
||||
include=[history_table.id]),
|
||||
})
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user