我有一张名为 HUGETABLE 的表。我想在某些 Select where 条件下获取 HUGETABLE 中一组记录所消耗的大小。我目前正在使用以下查询来获取 KBS 中的表大小,除此之外还有其他改进的查询吗?:
SELECT SUM(LENGTH(IFNULL(translation_logs.GUID,0))+
LENGTH(IFNULL(HUGETABLE.ID,0))+
LENGTH(IFNULL(HUGETABLE.SEQUENCENO,0))+
LENGTH(IFNULL(HUGETABLE.BID,0))+
LENGTH(IFNULL(HUGETABLE.TID,0))+
LENGTH(IFNULL(HUGETABLE.TABLENAME,0))+
LENGTH(IFNULL(HUGETABLE.MODIFIEDDATE,0))+
LENGTH(IFNULL(HUGETABLE.MODIFIEDBY,0))+
LENGTH(IFNULL(HUGETABLE.UPDATEXML,0))+
LENGTH(IFNULL(HUGETABLE.BESTIDENTIFIERVALUE,0)))/1024 AS "Total Size in KB"
FROM HUGETABLE
WHERE TID = 'myvalue';
TID 是索引字段