Mysql + big tables = slow queries?

前端 未结 2 1556
[愿得一人]
[愿得一人] 2021-01-13 20:54

I have some performance issues with a big table on Mysql : The table has got 38 million rows, its size is 3GB. I want to select by testing 2 columns : I tried many indexing

2条回答
  •  时光说笑
    2021-01-13 21:26

    The main thing you can do is to add indexes.

    Any time that you use a column in a where clause, make sure it has an index. There isn't one on your created column.

    The multi-index including the created column in essence is NOT an index on created since created isn't first in the multi-index.

    When using multi-indexes, you should almost always put the column with higher cardinality first. So, having the indexes be: (created, word_id), (word_id) would give you a significant boost.

提交回复
热议问题