When should database indexes be rebuilt?

前端 未结 3 1079
我在风中等你
我在风中等你 2020-12-14 01:52

I was reading about refactoring a large slow SQL Query over here, and the current highest response is from Mitch Wheat, who wants to make sure the query uses indexes for the

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-14 02:22

    It's usually a good idea to set up a cronjob to optimize indexes and check for errors.

    See mysqlcheck. A typical cron job looks something like mysqlcheck -Aaos , which checks all tables in all databases for errors, optimizes indexes, and only outputs on error.

提交回复
热议问题