Keep in mind, that indexes are only useful if you have a high variance in your data, like username or firstname, lastname. Something that is limited in its variabce, like a enum field - category for example which holds only 5 possible categories isnt the best choice to add an index ππ
Of course. For example table2 have column colF and foreign key to table1. If on colF not indexing and while table1 (any data) change we have exclusive table lock on table2. It's true for Oracle.
I have this problems many times.
Keep in mind, that indexes are only useful if you have a high variance in your data, like username or firstname, lastname. Something that is limited in its variabce, like a enum field - category for example which holds only 5 possible categories isnt the best choice to add an index ππ
It's not always true. Selective index is good but if you not index on column in foreign key you may can get big problem with locks.
Can you explain this a little further? :)
Of course. For example table2 have column colF and foreign key to table1. If on colF not indexing and while table1 (any data) change we have exclusive table lock on table2. It's true for Oracle.
I have this problems many times.
Cool, thank for sharing! I guess its kind if database agnostic, good to know for oracle! βοΈπ
Great advice! Thatβs certainly what I do in the real world and more often than not it will be two or three columns not just one
yeah for that you can use look up table