I have multiple tables in my database and I want to do database indexing . So what are best practices ?
On which values shou;d I create index?
You should index the fields where You are searching for… That sounds obvious, but without schemas, it’s difficult to say more.
What about on foreign_keys?
The system usually takes care of indexing reference fields.
A concrete example would be a User name, a product title, an event date etc.
No, really, I can’t recommend this resource enough.
3 Likes