You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an overloaded version of UpdateStart usingTimestamp(@NonNull BindMarker bindMarker) that should probably be used here in order to avoid having a new prepared statement to be created for each timestamp.
I was alerted by warnings logged from the cassandra nodes like: 157 prepared statements discarded in the last minute because cache limit reached (10 MB)
Verified that this is due to the timestamp not being specified as a BindMarker but as a literal value. This can be observed by inspecting the output of select * from system.prepared_statements ;.
The text was updated successfully, but these errors were encountered:
Thanks for bringing this up. I agree that in the context of prepared statements, this behavior could be better. QueryOptionsUtil isn't aware of whether the statement is being used with bind markers and how values are bound to these. That being said, such a change requires a bit more thought to find a way for a generic approach, similar to StatementBuilder.
mp911de
changed the title
Setting timestamp in UpdateOptions will create a new PreparedStatement everytime
Apply query options as bind markers to avoid new PreparedStatement creation
Jun 29, 2023
There is an overloaded version of
UpdateStart usingTimestamp(@NonNull BindMarker bindMarker)
that should probably be used here in order to avoid having a new prepared statement to be created for each timestamp.spring-data-cassandra/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/QueryOptionsUtil.java
Line 171 in e950084
I was alerted by warnings logged from the cassandra nodes like:
157 prepared statements discarded in the last minute because cache limit reached (10 MB)
Verified that this is due to the timestamp not being specified as a
BindMarker
but as a literal value. This can be observed by inspecting the output ofselect * from system.prepared_statements ;
.The text was updated successfully, but these errors were encountered: