From 54dd4a3ed7a03a6d9598ff5dcfa657344c6764bc Mon Sep 17 00:00:00 2001 From: lihangyu <15605149486@163.com> Date: Fri, 20 Sep 2024 10:54:11 +0800 Subject: [PATCH] [pick](short circuit) avoid set cacheId when non prepared execute (#40910) #40525 --- .../main/java/org/apache/doris/qe/PointQueryExecutor.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/PointQueryExecutor.java b/fe/fe-core/src/main/java/org/apache/doris/qe/PointQueryExecutor.java index dae9a94db3971b..9e4030b768b911 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/PointQueryExecutor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/PointQueryExecutor.java @@ -267,7 +267,10 @@ private RowBatch getNextInternal(Status status, Backend backend) throws TExcepti if (snapshotVisibleVersions != null && !snapshotVisibleVersions.isEmpty()) { requestBuilder.setVersion(snapshotVisibleVersions.get(0)); } - if (shortCircuitQueryContext.cacheID != null) { + // Only set cacheID for prepared statement excute phase, + // otherwise leading to many redundant cost in BE side + if (shortCircuitQueryContext.cacheID != null + && ConnectContext.get().command == MysqlCommand.COM_STMT_EXECUTE) { InternalService.UUID.Builder uuidBuilder = InternalService.UUID.newBuilder(); uuidBuilder.setUuidHigh(shortCircuitQueryContext.cacheID.getMostSignificantBits()); uuidBuilder.setUuidLow(shortCircuitQueryContext.cacheID.getLeastSignificantBits());