[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:
parent
50b4aca726
commit
2d31b562d8
5 changed files with 115 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue