表分区后 一张表的数据统计跟 直接进行表查询数据不一致
select
sum(table_rows )
from information_schema.partitions where
table_schema = schema()
and table_name='test';
和 我直接 select count(*) from test;两个的表的记录不一致啊。 查错了吗?
还有是 有的分区里面的数据 跟我直接带条件进行查询也不一致。 为什么?
sum(table_rows )
from information_schema.partitions where
table_schema = schema()
and table_name='test';
和 我直接 select count(*) from test;两个的表的记录不一致啊。 查错了吗?
还有是 有的分区里面的数据 跟我直接带条件进行查询也不一致。 为什么?
作者: huangdh12 发布时间: 2011-05-06
information_schema.partitions表里是大概的数据量
就和tables里面的数据一样,innodb引擎的是不精确的
就和tables里面的数据一样,innodb引擎的是不精确的
作者: rucypli 发布时间: 2011-05-06
information_schema.partitions里的数据并不是实时更新。
作者: iihero 发布时间: 2011-05-06
引用楼主 huangdh12 的回复:
select
sum(table_rows )
from information_schema.partitions where
table_schema = schema()
and table_name='test';
和 我直接 select count(*) from test;两个的表的记录不一致啊。 查错了吗?
还有是 有的分区里面的数据 ……
select
sum(table_rows )
from information_schema.partitions where
table_schema = schema()
and table_name='test';
和 我直接 select count(*) from test;两个的表的记录不一致啊。 查错了吗?
还有是 有的分区里面的数据 ……
information_schema里的数据不精确。
作者: zuoxingyu 发布时间: 2011-05-06