Genie.jl
Genie.jl copied to clipboard
Add note on what `add_index` does in the database table
Right now, the add index part of the database table creation is unclear. What does it do?
Indexes are used to retrieve data from the database very fast. The users cannot see the indexes, they are just used to speed up searches/queries
Why would every column not have an index?
@logankilpatrick because it's expensive. Indexing every column in every table will tax the DBMS too much in terms of index- maintenance processing, especially if the table has many attributes, many rows, and/or requires many inserts, updates, and/or deletes
Makes sense, so what is the rule of thumb for which to index?
Also, this should explain more clearly: https://stackoverflow.com/a/5448055/4417582
That helps! Thank you :)
?
It depends: https://stackoverflow.com/questions/107132/what-columns-generally-make-good-indexes
can be unique, the one that you accesses frequently, also depends what speeds up your query