MySql - slow sending data phase

前端 未结 6 1163
醉话见心
醉话见心 2020-12-14 01:03

One of my queries on MySQL 5.0.45 is running slow in \"sending data\" phase. The query is a simple select, returns about 300 integer ID fields as result set.

mysq         


        
6条回答
  •  旧巷少年郎
    2020-12-14 01:26

    I had two index (date_index and id) ,

    i had WHERE date_index>NOW() - INTERVAL 24 HOURS and an ORDER BY id in query, MySql preferred id as index and it didn't use date_index that caused long query time for big tables.

    i found it in a legacy system after 5 years that tables was grown.

提交回复
热议问题