gpt4 book ai didi

cassandra - 轻量级事务是否支持带有 if 的删除语句?

转载 作者:行者123 更新时间:2023-12-05 01:00:34 28 4
gpt4 key购买 nike

我读过轻量级事务只支持带有“if”和“if exists”子句的更新和插入语句。他们是否也支持带有“if exists”子句的删除语句。

例如:创建表用户(用户ID文本,电子邮件文本,主键(电子邮件))

从 userid='kris' 如果存在的用户中删除

轻量级事务是否支持上述删除语句?

最佳答案

是的,CQL DELETE 语句确实支持 IF EXISTS条款。来自 DELETE documentation :

In Cassandra 2.0.7 and later, you can conditionally delete columns using IF or IF EXISTS. Deleting a column is similar to making an insert or update conditionally. Conditional deletions incur a non-negligible performance cost and should be used sparingly.



但是,就 Carlo 而言,请注意最后一句话。从性能的角度来看,条件删除不是免费的。

关于cassandra - 轻量级事务是否支持带有 if 的删除语句?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29454901/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com