Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: tiflash
[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version] V6.5.0
[Encountered Problem: Problem Phenomenon and Impact] When using TiFlash replicas for aggregation statistics, why does the execution plan perform a full partition scan instead of using the index?
[Resource Configuration]
[Attachment: Screenshot/Log/Monitoring]
Table Structure:
CREATE TABLE lpcs_mt_result
(
id
bigint(16) NOT NULL
/*T![auto_rand] AUTO_RANDOM(5) */
COMMENT ‘id’,
message_result
varchar(20) NOT NULL,
provider_type
varchar(16) NOT NULL DEFAULT ‘’,
sign
varchar(64) NOT NULL DEFAULT ‘’,
PRIMARY KEY (id
, request_time
)
/*T![clustered_index] CLUSTERED */,
KEY idx_messageresult_providertype_sign
(message_result
, provider_type
, sign
)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin