我正在尝试评估在我们的应用程序的一个表中创建的tombstones的数量。为此,我尝试使用nodetool cfstats。我是这样做的:
create table demo.test(a int, b int, c int, primary key (a));
insert into demo.test(a, b, c) values(1,2,3);现在,我正在做与上面相同的插入。因此,我希望创建3个墓碑。但是在运行这个列族的cfstats时,我仍然看到没有创建任何tombstones。
nodetool cfstats demo.test
Average live cells per slice (last five minutes): 0.0
Average tombstones per slice (last five minutes): 0.0现在我尝试删除该记录,但我仍然没有看到创建任何墓碑。这里有什么我遗漏的东西吗?请提个建议。
顺便说一下其他一些细节,*我们使用的是2.1.1版的Java驱动程序*我们运行的是Cassandra 2.1.0
发布于 2014-11-22 00:28:44
对于查询的tombstone计数,最好的方法是启用跟踪。这将为您提供查询的深度历史记录,包括必须读取多少块墓碑才能完成查询。这不会给出逻辑删除总数,但很可能与性能调优有关。
在cqlsh中,您可以使用以下命令启用此功能
cqlsh> tracing on;
Now tracing requests.
cqlsh> SELECT * FROM ascii_ks.ascii_cs where pkey = 'One';
pkey | ckey1 | data1
------+-------+-------
One | One | One
(1 rows)
Tracing session: 2569d580-719b-11e4-9dd6-557d7f833b69
activity | timestamp | source | source_elapsed
--------------------------------------------------------------------------+--------------+-----------+----------------
execute_cql3_query | 08:26:28,953 | 127.0.0.1 | 0
Parsing SELECT * FROM ascii_ks.ascii_cs where pkey = 'One' LIMIT 10000; | 08:26:28,956 | 127.0.0.1 | 2635
Preparing statement | 08:26:28,960 | 127.0.0.1 | 6951
Executing single-partition query on ascii_cs | 08:26:28,962 | 127.0.0.1 | 9097
Acquiring sstable references | 08:26:28,963 | 127.0.0.1 | 10576
Merging memtable contents | 08:26:28,963 | 127.0.0.1 | 10618
Merging data from sstable 1 | 08:26:28,965 | 127.0.0.1 | 12146
Key cache hit for sstable 1 | 08:26:28,965 | 127.0.0.1 | 12257
Collating all results | 08:26:28,965 | 127.0.0.1 | 12402
Request complete | 08:26:28,965 | 127.0.0.1 | 12638http://www.datastax.com/dev/blog/tracing-in-cassandra-1-2
https://stackoverflow.com/questions/27063508
复制相似问题