I've hit the DB performance bottleneck, where now?

后端 未结 7 1704
自闭症患者
自闭症患者 2021-02-15 18:37

I have some queries that are taking too long (300ms) now that the DB has grown to a few million records. Luckily for me the queries don\'t need to look at the majority of this d

7条回答
  •  生来不讨喜
    2021-02-15 19:11

    1. Make sure all your indexes are optimized. Use explain on the query to see if it is using your indexes efficiently.
    2. If you are doing some heavy joins then start thinking about doing this calculation in java.
    3. Think of using other DBs such NoSQL. You maybe able to do some preprocessing and put data in Memcache to help you a little.

提交回复
热议问题