Prevent tombstones creation

谁都会走 提交于 2019-12-02 04:02:14

Don't include col3 in your insert and it just wont set anything.

insert into my_table(col1,col2) values(val1,val2)

If curious about structure on disk, do a nodetool flush and run sstabledump on the sstable created to see difference.

If you insert null values, Cassandra will create tombstones. If you know that col3 will be null, don't use it in your query.

insert into my_table(col1,col2) values(val1,val2)

I would suggest two really good articles on the subject

Assuming you are using prepared statements you can use the "unset" functionality that was introduced in Cassandra 2.2.0, which lets you use leave prepared statement variables without values and without creating tombstones on the server. It is supported in the Java driver 3.0.0 and other drivers.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!