Questions tagged [secondary-indexes]

an index which is created other than index based on primary key, to speed up processing.

Indexing of secondary keys can only be done when the key is ordered. An index file stores the position of the record a particular category.

In this example, a secondary key is ordered alphabetically, the first record which starts with b is #14, the first record which starts with c is #26

Index file:                    Database:

Category | Start position      ID | First_name
---------|---------------      ---|-----------
a        | 1                   1  | Aaron
b        | 14                  2  | Abe
c        | 26                  ...
d        | 34                  14 | Barry

A query run on the data will be much faster, instead of looking at every record, the program can skip to start position of the category for the first letter of their name. For example, if this query was run:

SELECT First_name
FROM database
WHERE First_name = "Bryan"

The program would search for barry between records 14 - 25 rather than looking at all the records in the database.

123 questions
0
votes
1 answer

HBase Secondary Index using coprocessor

I am implementing secondary index for a HBase table using coprocessor. Once the rowkey is put in the index table, will it automatically scan the index table if the primary table is scanned. How does the linking happen? I am referring to the…
Thelight
  • 359
  • 1
  • 5
  • 15
0
votes
2 answers

Best way to search Cassandra by Non primary key column

I am storing historical timeseries data into Cassandra. cassandra@cqlsh>CREATE TABLE data."InstrumentTimeSeries" ( key blob, column1 bigint, value blob, PRIMARY KEY (key, column1) ) WITH COMPACT STORAGE AND bloom_filter_fp_chance =…
Anil Kapoor
  • 644
  • 6
  • 19
0
votes
2 answers

Performing a conditional expression query on GSI in dynamodb

I know the query below is not supported in DynamoDB since you must use an equality expression on the HASH key. query({ TableName, IndexName, KeyConditionExpression: 'purchases >= :p', ExpressionAttributeValues: { ':p': 6 } }); How…
Daniel Kobe
  • 9,376
  • 15
  • 62
  • 109
0
votes
0 answers

How to index high cardinality column in cassandra

I have a column of high cardinality and i need to index that column, because i have to perform range queries on that column. I know that secondary indexes are not fit for high cardinality column in cassandra, so i tried to create materialized view…
pavs
  • 141
  • 1
  • 8
0
votes
1 answer

Reading distinct local secondary index keys of a DynamoDB table

Assume I have staff table with primary key composing of organization_id as partition key and staff_id as sort key. On the other hand I have department local secondary index with department_id as sort key. { ... KeySchema: [ { AttributeName:…
kokeksibir
  • 1,725
  • 2
  • 18
  • 30
0
votes
1 answer

Unable to use stream UDFs on MAPKEYS index

I have a bin with map as datatype and created a secondary on MAPKEYS. Now i want to run a udf with filter on MAPKEYS index. It gives the error AEROSPIKE_ERR_INDEX_NOT_FOUND. This is my aql query: aql> aggregate test.check_password('hii') on…
Swetha
  • 87
  • 9
0
votes
1 answer

Structuring a large DynamoDB table with many searchable attributes?

I've been struggling with the best way to structure my table. Its intended to have many, many GBs of data (I haven't been given a more detailed estimate). The table will be claims data (example here) with a partition key being the resourceType and a…
Funsaized
  • 1,972
  • 4
  • 21
  • 41
0
votes
2 answers

What strategies exist to find unreachable keys in a key/value database?

TL;DR How can you find "unreachable keys" in a key/value store with a large amount of data? Background In comparison to relational database that provide ACID guarantees, NoSQL key/value databases provide fewer guarantees in order to handle "big…
0
votes
2 answers

Dynamodb will consider the secondary index also a primary key, before put item into table.?

I have the table named as message_tbl in dynamodb for messaging system. For the purpose to fetch all the message items related to particular conversation_id, i designed the table like this: The attributes are: Primary Hash key =>…
ArunValaven
  • 1,753
  • 2
  • 25
  • 44
0
votes
2 answers

How select elements for every userId from table

I have create table user in cassandra create table users (pcId int , userId int, friendId int, age int, score int , name text, PRIMARY KEY (pcId, userId, friendId, score)) and I insert data: INSERT INTO users(pcid , userid , score , friendid , …
kaio
  • 131
  • 1
  • 10
0
votes
1 answer

dynastyjs: how to find item(s) using secondary global index

I have a table: digital_asset, it's partition key is: id. It has a global secondary index: ean-index with partitioning-key: ean. I'd like to be able to query the table using the secondary index using dynastyjs. With aws-sdk I would do this: return…
Gavriel
  • 18,880
  • 12
  • 68
  • 105
0
votes
1 answer

Will secondary index create another copy of data in cassandra?

I have been through this document but here it doesn't say if the data is made a copy of because of secondary index or its just having links to other data ?
mehnaazm
  • 287
  • 1
  • 4
  • 14
0
votes
2 answers

N1QL secondary index not working with parameterized IN clause

Using com.couchbase.client, java-client version 2.2.7 I have been unable to get a n1ql secondary index working that uses a parameterized IN clause. See my example index, query, and java code below Index CREATE INDEX `indexName` ON…
Marquis Blount
  • 7,585
  • 8
  • 43
  • 67
0
votes
2 answers

how to create cluster key in mysql?

I have a table rooms and user. In the table user I want store room_id is the cluster key and id_user can be duplicate. Example room1 have user (1,2,3..), room2 have users (1,2,3). And name of user can be different ex: with room1 i have the id user…
Hudo
  • 77
  • 1
  • 6
0
votes
1 answer

Apache Phoenix csvbulkloadTool failed

I am using the following Linux command: hadoop jar phoenix-4.6.0-HBase-0.98-client.jar org.apache.phoenix.mapreduce.CsvBulkLoadTool --table TT --input /tmp/text.csv This command works successfully, but no data from csv file is loaded in hbase…
paul
  • 11
  • 4
1 2 3
8 9