Closed sambles closed 6 hours ago
Amir: For tables that have group_id in them, I think it also makes sense to have index on group_id, if group_id points to a group of users that belong to a separate security group/organisations. I think group_id index will help finding resources belonging to that group quicker.
Not 100% sure about this but if there is any field that a list query sorts the result based on that, I think indexing on that field might be beneficial. Also any parameter that list endpoints accept as filter parameters could be helpful. But I guess it’s too many index additions it’s better to do it in stages. Because indices consume additional storage in the DB so there might be a considerable storage impact if too many things are indexed.
Issue Description
Django supports putting
db_index=True
on model fields, this can speed up DB level fetch requests:types-of-database-indexing-in-django https://docs.djangoproject.com/en/5.1/ref/models/indexes/