Skip to content

Commit 54dd4a3

Browse files
authored
[pick](short circuit) avoid set cacheId when non prepared execute (#40910)
#40525
1 parent 02ee7ae commit 54dd4a3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fe/fe-core/src/main/java/org/apache/doris/qe/PointQueryExecutor.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,10 @@ private RowBatch getNextInternal(Status status, Backend backend) throws TExcepti
267267
if (snapshotVisibleVersions != null && !snapshotVisibleVersions.isEmpty()) {
268268
requestBuilder.setVersion(snapshotVisibleVersions.get(0));
269269
}
270-
if (shortCircuitQueryContext.cacheID != null) {
270+
// Only set cacheID for prepared statement excute phase,
271+
// otherwise leading to many redundant cost in BE side
272+
if (shortCircuitQueryContext.cacheID != null
273+
&& ConnectContext.get().command == MysqlCommand.COM_STMT_EXECUTE) {
271274
InternalService.UUID.Builder uuidBuilder = InternalService.UUID.newBuilder();
272275
uuidBuilder.setUuidHigh(shortCircuitQueryContext.cacheID.getMostSignificantBits());
273276
uuidBuilder.setUuidLow(shortCircuitQueryContext.cacheID.getLeastSignificantBits());

0 commit comments

Comments
 (0)