secondary-indexes

Why secondary indexes are less efficient in Cassandra?

柔情痞子 提交于 2021-01-24 07:06:08
问题 I read in Cassandra documentation that creating secondary index is less efficient as because in worst case it need to touch all nodes in order to find out the data of that non-key column. But my doubt is even if we do not create secondary index, then also it will have to touch all nodes (in worst case) and find out where that particular row with this non-key column value resides. Note: Yeah, I understand that it is possible that if the cardinality is high then the secondary index will contain

Secondary in-memory index representations in Python

老子叫甜甜 提交于 2020-03-18 09:46:57
问题 I am searching for an efficient solution to build a secondary in-memory index in Python using a high-level optimised mathematical package such as numpy and arrow. I am excluding pandas for performance reasons. Definition "A secondary index contains an entry for each existing value of the attribute to be indexed. This entry can be seen as a key/value pair with the attribute value as key and as value a list of pointers to all records in the base table that have this value." - JV. D'Silva et al.

Cassandra query on secondary index is very slow

放肆的年华 提交于 2020-01-04 05:31:08
问题 We have a table with about 40k rows, querying on secondary index is slow(30 seconds on production). Our cassandra is 1.2.8. The table schema is as following: CREATE TABLE usertask ( tid uuid PRIMARY KEY, content text, ts int ) WITH bloom_filter_fp_chance=0.010000 AND caching='KEYS_ONLY' AND comment='' AND dclocal_read_repair_chance=0.000000 AND gc_grace_seconds=864000 AND read_repair_chance=0.100000 AND replicate_on_write='true' AND populate_io_cache_on_flush='false' AND compaction={'class':

Can't I compare two different attributes in DynamoDB?

我们两清 提交于 2019-12-24 07:33:36
问题 I'm new to Dynamo Db. And my Application says I need to write a program in which two attributes must be compared by their date values. I used GSI for this but what I found was, using GSI I can query all the attributes but separately. But I have to compare two different attributes by their date values so that I can move forward in my application for further. Thank you :) 回答1: You can not compare two attributes. DynamoDB conditions are bound to an attribute. You will have to write this

Can't I compare two different attributes in DynamoDB?

99封情书 提交于 2019-12-24 07:32:42
问题 I'm new to Dynamo Db. And my Application says I need to write a program in which two attributes must be compared by their date values. I used GSI for this but what I found was, using GSI I can query all the attributes but separately. But I have to compare two different attributes by their date values so that I can move forward in my application for further. Thank you :) 回答1: You can not compare two attributes. DynamoDB conditions are bound to an attribute. You will have to write this

Optional secondary indexes in DynamoDB

蹲街弑〆低调 提交于 2019-12-17 20:44:10
问题 I am migrating my persistence tier from Riak to DynamoDB. My data model contains an optional business identifier field, which is desired to be able to be queried as an alternative to the key. It appears that DynamoDB secondary indexes can't be null and require a range key, so despite the similar name to Riak's secondary indexes, make this appear quite a different beast. Is there an elegant way to efficiently query my optional field, short of throwing the data in an external search index? 回答1:

How to query a Dynamo DB having a GSI with only hashKeys using DynamoDBMapper

最后都变了- 提交于 2019-12-17 19:35:32
问题 I am very new to Dynamo DB and may be this is very trivial question, but i went through the documents of Dynamo DB and stack overflow questions but i couldnt find a single link which tells how to query DDB for GSI which has only hash key and there are no range key specified for the same. I get the exception Illegal query expression: No hash key condition is found in the query. 回答1: On your DynamoDB annotated model object, you should use @DynamoDBIndexHashKey(globalSecondaryIndexName =

SASI Indexes in Cassandra seem to have some bugs

扶醉桌前 提交于 2019-12-13 13:45:25
问题 I just started working with the SASI index on Cassandra 3.7.0 and I encountered a problem which as I suspected was a bug. I had hardly tracked down the situation in which the bug showed up, here is what I found: When querying with a SASI index, it may incorrectly return 0 rows , and changing a little conditions, it works again, like the following CQL code: CREATE TABLE IF NOT EXISTS roles ( name text, a int, b int, PRIMARY KEY ((name, a), b) ) WITH CLUSTERING ORDER BY (b DESC); insert into

Riak: are my 2is broken?

ぐ巨炮叔叔 提交于 2019-12-13 03:38:37
问题 we're having some weird things happening with a cleanup cronjob and riak: the objects we store (postboxes) have a 2i for modification date (which is a unix timestamp). there's a cronjob running freqently deleting all postboxes that have not been modified within 180 days. however we've found evidence that postboxes that some (very little) postboxes that were modified in the last three days were deleted by this cronjob. After reviewing and debugging several times over every line of code, I am

DynamoDB - Querying for the greatest value of a range key

依然范特西╮ 提交于 2019-12-11 12:31:43
问题 I have a DynamoDB table which has the following structure HK | RK | A1 | A2 | A3 (Hash Key) | (Range Key) I have a local secondary index whose range key is A3 . I want to find out for a specific Hash key HK , what is the greatest value of the attribute A3 . So I query the secondary index like this: Map<String, AttributeValue> eav = new HashMap<>(); eav.put(":v1", new AttributeValue().withS("hash value")); queryExpression = new DynamoDBQueryExpression<Table>() .withIndexName("index-name")