我正在使用如下选择查询从 mysql(使用 python)读取表:
select * from tablename1 where date1= curdate();
我在 tablename1 中有 798 行,但它正在检查比现有更多的行。为什么?
explain select * from tablename1 where date1= curdate();
输出:
id select_type table type possible_keys key key_len ref rows Extra
0 1 SIMPLE tablename1 ALL None None None None 1039 Using where
我搜索了它,但我无法弄清楚这一点。如何优化我的查询?
我试过保留主键,但没有用。