关于Mysql含有blob字段的查询效率问题

一、问题现象

奇怪的问题:

数据库版本:Mysql 8.0.19

表字段:id(主键),accountId(btree普通索引),....,imgCotent(big blob),imgThumbnail(blob)....

记录数:15000左右;

表数据大小:700M左右

 

二、执行以下查询:

select count(*) from tablename

执行时间:11秒多;

select count(id) from tablename

执行时间:同上,11秒多;

select count(accountId) from tablename

执行时间:仅有 0.068秒!!!!!!

 

哪位高人能给指点一下?

posted @ 2021-10-08 21:01  三晋一枝发  阅读(462)  评论(0编辑  收藏  举报