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
1
vote
1 answer

Phoenix create SecondaryIndex timeout

I'm new to Phoenix and encountered a problem. Firstly, I created a table with 30000000 records by java on Phoenix. Then, I want to create a phoenix global secondIndex to the table. But, when the program runed for 10 minutes, the java client throws…
xdlwd086
  • 21
  • 1
1
vote
2 answers

Cassandra SELECT on secondary index doesn't return row

I am dealing with a puzzling behaviour when doing SELECTs on Cassandra 2.2.3. I have 4 nodes in the ring, and I create the following keyspace, table and index. CREATE KEYSPACE IF NOT EXISTS my_keyspace WITH replication = {'class':…
1
vote
1 answer

Does Phoenix Secondary Indexes handle WAL log specially?

We are using phoenix and hbase-indexer for our hbase cluster and we have found a curious phenomenon about phoenix secondary indexes : We put data (use psql to import csv data) into one table(C_PICRECORD) with two global mutable index…
CrazyPig
  • 137
  • 12
1
vote
1 answer

Querying Cassandra meta-data for the presence of a secondary index

Using version 3 of the Cassandra Java driver, how do you determine whether a column has a secondary index on it? Using version 2 of the driver, I could simply check whether ColumnMetadata.getIndex() returns non-null. But that method was…
Raedwald
  • 46,613
  • 43
  • 151
  • 237
1
vote
0 answers

Riak performance with multiple secondary indexes(2i)

I'm doing a plan for a system and I'm considering changing the database from a relational model to a KV with extra feature like Riak. Most of the functionality for the requirements can be modeled in KV without any problem but for those corner cases…
joaonrb
  • 965
  • 11
  • 30
1
vote
1 answer

Primary Key and GSI Design in DynamoDB

I've recently started learning DynamoDB and created a table 'reviews' with the following attributes (along with the DynamoDB type): productId - String username - String feedbackText - String lastModifiedDate - Number (I'm storing the UNIX…
vksinghh
  • 223
  • 4
  • 16
1
vote
2 answers

DynamoDB Xcode6 Swift using three columns as key

I am trying to use a DynamoDB table to store this data: DartsPlayerInsultTable CustomerId String PlayerId String PlayerInsult String Using the method (concept, not code) described…
iWombat
  • 11
  • 2
1
vote
1 answer

cassandra search a row by secondary index returns null

I have created a TABLE and index As follows CREATE TABLE refresh_token ( user_id bigint, refresh_token text, access_token text, device_desc text, device_type text, expire_time timestamp, org_id bigint, PRIMARY KEY…
quemilk
  • 67
  • 6
1
vote
2 answers

Validating row at client side better than secondary index with whole primary key?

In cassandra, it's well known that secondary indexes should be used very sparingly. If I have a table for example: User(username, usertype, email, etc..) Here username is partition key. Now I want to support operation which returns a specific…
pinkpanther
  • 4,770
  • 2
  • 38
  • 62
1
vote
1 answer

Riak secondary indexes (2i) - write performance

What is the performance impact of including secondary indexes (2i) in an object written to Riak? Let's consider two scenarios, both with a large number of objects within one bucket. Each object has a secondary index, let's call it example_bin (but…
Pavel S.
  • 11,892
  • 18
  • 75
  • 113
1
vote
1 answer

Can't I compare two different attributes in DynamoDB?

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…
1
vote
1 answer

UpdateItemRequest - updating multiple items using Local Secondary Index

I have a DynamoDB table Contact, where userId is a hashKey and id is a range key. Now, there are also parameters like categoryId and deleted ( true|false ). I need to update all user's contacts within the certain category ( categoryId should be…
user3489820
  • 1,459
  • 3
  • 22
  • 38
1
vote
1 answer

get values form global secondary indexes table

I am using DynamoDB and zend framework. I am able to fetch row from normal table using this. $response['Items'] = $this->dbClient->query( array( "TableName" => "user", "KeyConditions" => array( …
keen
  • 3,001
  • 4
  • 34
  • 59
1
vote
1 answer

Cassandra-secondary index on part of the composite key?

I am using a composite primary key consisting of 2 strings Name1, Name2, and a timestamp (e.g. 'Joe:Smith:123456'). I want to query a range of timestamps given an equality condition for either Name1 or Name2. For example, in SQL: SELECT * FROM…
James
  • 118
  • 1
  • 10
0
votes
1 answer

How do I update global secondary indexes and keys in dynamodb table from my dynamodb schema update?

I have a schema const schema = new Schema( { id: { type: String, hashKey: true, required: true, }, name: { type: String, required: true, }, email: { type: String, index: { …
Kescript
  • 30
  • 6
1 2 3
8 9