[WEB-4823] chore: Add compound indexing for notification fields to improve query performance (#7691)

* dev: handled indexing for the notification fields

* dev: removing indexing related to workspaces

* dev: handled indexing for file asset, user favorite, and page log

* dev: indexing concurrently
This commit is contained in:
guru_sainath 2025-09-02 14:18:13 +05:30 committed by GitHub
parent 50b4aca726
commit 2d31b562d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 115 additions and 1 deletions

View file

@ -76,6 +76,15 @@ class FileAsset(BaseModel):
verbose_name_plural = "File Assets"
db_table = "file_assets"
ordering = ("-created_at",)
indexes = [
models.Index(fields=["entity_type"], name="asset_entity_type_idx"),
models.Index(
fields=["entity_identifier"], name="asset_entity_identifier_idx"
),
models.Index(
fields=["entity_type", "entity_identifier"], name="asset_entity_idx"
),
]
def __str__(self):
return str(self.asset)