We have recently observed some issue that we trying to the find the root cause for. The issue was we are seeing some performance impact where in write and read to cassandra clusters are slow. Looking at the logs, we noticed a tombstones and a lot of prepared statements discard warnings. Tombstones is something we have under control. We are a little unclear about why our application is prepared so many prepared statements, looking in the system.prepared_statements, we noticed a lot of entries as below. insert into table1(col1, col2, col3, col4, col5) values(?,?,?,100,125); insert into table1(col1, col2, col3, col4, col5) values(?,?,?,25,500);
Within our code, we are using spring-data-cassandra with CQLOperations insert to save the object. In its simple form, the object looks like this.
@Table("table1")
public class table_1{
@NonNull
@PrimaryKeyColumn(type = PARTITIONED)
private string col1;
@Default
@PrimaryKeyColumn(type = PARTTIONED, ordinal = 1)
private String col2="";
@Default
@PrimaryKeyColumn(type = CLUSTERED)
private String col3 = "";
private long col4;
private double col5;
}
I am trying to understand if the way we defined the above class drives how the insert CQLOperations insert is optimized?
We do not see this issue when we use datastax api with mapper to save the object.
Thank you!