re: SQL 201: Speed up your queries with Indexes VIEW POST


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 πŸ˜ŠπŸ‘


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


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.


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! ✌️😊

code of conduct - report abuse