在created_at列加索引的前提下。表數(shù)據(jù)量千萬(wàn)級(jí)別。explain顯示掃描行數(shù)是二百萬(wàn)的級(jí)別 select count(*) from users where created_at<'2018-08-28 00:00:00' and created_at>='2018-08-01 00:00:00' count大概是四五十萬(wàn)級(jí)的別。這種范圍查詢 created_at用int時(shí)間戳和timestamp性能上哪種會(huì)比較好
添加回答
舉報(bào)
0/150
提交
取消