SELECT DISTINCT date( created_at ) AS ‘est_date’
FROM clip
WHERE created_at > DATE_SUB( NOW( ) , INTERVAL DAYOFMONTH( NOW( ) )
DAY )
AND channel_id = ‘xxxx’
LIMIT 0 , 30

这个是在 基数 为 250643 channel_id 建索引的情况下查询的结果

查询花费 0.0006 秒(时间比较经济)

id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE clip ref channel_id channel_id 4 const 24 Using where; Using temporary

]]>