smiklosovic commented on code in PR #3605:
URL: https://github.com/apache/cassandra/pull/3605#discussion_r1814497245


##########
src/java/org/apache/cassandra/cql3/QueryProcessor.java:
##########
@@ -674,14 +678,14 @@ public static ResultMessage.Prepared 
storePreparedStatement(String queryString,
     {
         // Concatenate the current keyspace so we don't mix prepared 
statements between keyspace (#5352).
         // (if the keyspace is null, queryString has to have a fully-qualified 
keyspace so it's fine.
-        long statementSize = ObjectSizes.measureDeep(prepared.statement);
+        MD5Digest statementId = computeId(queryString, keyspace);
         // don't execute the statement if it's bigger than the allowed 
threshold
-        if (statementSize > 
capacityToBytes(DatabaseDescriptor.getPreparedStatementsCacheSizeMB()))
+        if ((prepared.pstmntSize + statementId.size()) > 
capacityToBytes(DatabaseDescriptor.getPreparedStatementsCacheSizeMB()))

Review Comment:
   we might use  `getSizeForCache` for `(prepared.pstmntSize + 
statementId.size()`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to