当我们使用IF NOT EXIST时,LWT-轻量级交易如何工作? [英] How the LWT- Light Weight Transaction is working when we use IF NOT EXIST?
问题描述
问题是,当我们使用
INSERT INTO USERS (login, email, name, login_count)
values ('jbellis', 'jbellis@datastax.com', 'Jonathan Ellis', 1)
IF NOT EXISTS
如果不存在中的
确切地将哪些列进行了比较?主键(分区键+集群键)?还是只是分区键?
in IF NOT EXIST exactly which columns are compared together? primary key(partition-key + clustering-key)? or just partition-key?
推荐答案
Here is a diagram of the 4 phases of LWT: http://www.slideshare.net/doanduyhai/cassandra-introduction-nantesjug/89
原始博客文章在这里: http://www.datastax.com/dev/blog/lightweight-transactions-in-cassandra-2-0
The original blog post is here: http://www.datastax.com/dev/blog/lightweight-transactions-in-cassandra-2-0
究竟哪几列比较在一起?首要的关键?分区键?
exactly which columns are compare together? primary key? partition-key?
整个主键都在磁盘上检查.在示例中,它是一个简单的主键,因此它也是分区键,例如登录列
The whole primary key is checked on disk. In the example it is a simple primary key so it's also the partition key, e.g. login column
这篇关于当我们使用IF NOT EXIST时,LWT-轻量级交易如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!