Do indexes suck in SQL?
问题 Say I have a table with a large number of rows and one of the columns which I want to index can have one of 20 values. If I were to put an index on the column would it be large? If so, why? If I were to partition the data into the data into 20 tables, one for each value of the column, the index size would be trivial but the indexing effect would be the same. 回答1: It's not the indexes that will suck. It's putting indexes on the wrong columns that will suck. Seriously though, why would you need