What is the cost of indexing multiple db columns?

后端 未结 7 1432
孤街浪徒
孤街浪徒 2020-12-19 07:02

I\'m writing an app with a MySQL table that indexes 3 columns. I\'m concerned that after the table reaches a significant amount of records, the time to save a new record wi

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-19 07:42

    Without some more details about expected usage of the data in your table worrying about indexes slowing you down smells a lot like premature optimization that should be avoided.

    If you are really concerned about it, then setup a test database and simulate performance in the worst case scenarios. A test proving that is or is not a problem will probably be much more useful then trying to guess and worry about what may happen. If there is a problem you will be able to use your test setup to try different methods to fix the issue.

提交回复
热议问题