Add index on Status.remote_id
This field is often used in WHERE-clauses in queries that are very slow on bookwyrm.social.
This commit is contained in:
parent
f28800af7f
commit
4bbdd0b2d0
2 changed files with 22 additions and 0 deletions
|
@ -80,6 +80,9 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
|
|||
"""default sorting"""
|
||||
|
||||
ordering = ("-published_date",)
|
||||
indexes = [
|
||||
models.Index(fields=["remote_id"]),
|
||||
]
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
"""save and notify"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue