Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: jdbc batch insert的时候执行计划缓存不生效
Using JDBC’s prepare statement and batchexecute method to insert data with a batch size of 4000, I cannot see queries using plan cache ops on the performance overview panel, and the proportion of dbtime spent on compilation is relatively high.
In TiDB monitoring, you can view the request command types through Query Summary > QPS By Instance. If COM_QUERY
in the request is replaced by COM_STMT_EXECUTE
or COM_STMT_PREPARE
, it takes effect.
I couldn’t find QPS by instance, only CPS by instance. [IMG_2890.HEIC|attachment]
It should be a mistake on the official website.
I couldn’t find any of the metrics you mentioned.
But it seems to be reused in the dashboard, seeking explanation.
Try using JDBC:mysql://{TiDBIP}:{TiDBPort}/{DBName}?characterEncoding=utf8&useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&prepStmtCacheSqlLimit=10000000&useConfigs=maxPerformance&rewriteBatchedStatements=true&defaultfetchsize=-2147483648
(JDBC Driver 5.1 has better compatibility)
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.