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
2
votes
1 answer

Why secondary indexes are less efficient in Cassandra?

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,…
2
votes
1 answer

Is it recommended to use aerospike to filter on some field

I have around 2 millions records, each record having 10-12 fields(mostly are string). Now I want to filter records on the basis of some field. Is it advisable to do this using secondary index or some other better option is available? Also, how much…
2
votes
1 answer

Do DynamoDB Secondary Indexes Get Rewritten if no attributes change inside it?

In the AWS documentation: Whenever a write occurs on a table, all of the table's indexes must be updated. In a write-heavy environment with large tables, this can consume large amounts of system resources. In a read-only or read-mostly…
Jeff Vdovjak
  • 1,833
  • 16
  • 21
2
votes
1 answer

Cassandra secondary index backups and recovery

I have set up a Cassandra cluster with 2 dc. DC1 - 9 nodes, rep 5, consistency - local quorum. DC2 - 4 nodes, rep 3, consistency - local quorum. Have been testing backups and restore and observed that it takes very long time to repair the node…
2
votes
1 answer

How does aparapi getGlobalId works?

I am beginner with aparapi. I have a problem with getGlobalId. My code is very simple. I only want to add two arrays but the result is wrong. I debugged the program and i saw that getGlobalId is not taking the corrected values. My code is: int…
2
votes
2 answers

What is the definition of secondary index in postgresql?

From https://www.postgresql.org/docs/9.6/static/indexes-index-only-scans.html: All indexes in PostgreSQL are secondary indexes, meaning that each index is stored separately from the table's main data area (which is called the table's heap in…
user3284469
2
votes
1 answer

AWS DynamoDB Item access (get/put/delete) using Global Secondary Indexes

Is there a possibility to access (get/put/delete) items of a DynamoDB table using the Global Secondary Indexes (GSI)? So far, I only see the possiblity of querying over a GSI.
2
votes
0 answers

Cassandra: high CPU usage and unresponsive DB, probably due to a stuck secondary index building - how to stop the index building process?

In a single-node installation of Cassandra 3.7 on a VM running Debian, I have a table with about 20 million rows. In order to be able to select the data that was inserted during the last few days, I used Datastax DevCenter 1.6.0 to execute a…
maccer
  • 331
  • 3
  • 8
2
votes
1 answer

Cassandra with SSTable Attached Secondary Index vs relational database

I am new to nosql database such as Cassandra, and currently I saw this secondary index and sstable attached secondary index. Some how I am confused about the purpose to use secondary index in Cassandra, what's the difference between relational…
Schmidt
  • 51
  • 7
2
votes
1 answer

DynamoDB - Querying for the greatest value of a range key

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…
Thiyagu
  • 17,362
  • 5
  • 42
  • 79
2
votes
1 answer

Dynamodb with unique secondary/third index

I'm getting ready to rebuild a database that has 3 different tables all containing the same data. the difference is the HashKey for each, UserId, UserName, Email. I'm trying to combine them all into one table as I think the redundancy is bad as well…
2
votes
0 answers

Does Bitmap indexing for a 64-bit flag column in a table will improve retrieval in Oracle?

I have a table and it has a 64-bit flag column named "flags". Each bit in the "flags" column represents a value. I have to search on the table for each of the bits in "flags" column. Shall i put an index over the column "flags" for faster retrieval?…
2
votes
2 answers

Cassandra's secondary index Vs DSE solr indexing

I would like to know the performance difference for Cassandra's secondary index vs. DSE's solr indexing placed on CF's. We have a few CF's that we did not place secondary indices on because we were under the impression that secondary indices would…
jimnkey
  • 372
  • 2
  • 10
2
votes
2 answers

Cassandra: secondary indexes for queries with multiple WHERE clauses

I want to make an efficient compound key to work WHERE queries with multiple conditions like: SELECT * FROM playlists WHERE album = 'We Must Obey' artist = 'Fu Manchu' AND title = 'Ojo Rojo' ORDER BY song_order ASCENDING ALLOW…
andandandand
  • 21,946
  • 60
  • 170
  • 271
1
vote
1 answer

Dynamodb global secondary index composite sort key

I'm new to dynamodb and trying to create a global secondary index for addition access patterns. How can I create dynamoDB GSI with composite sort key? For example: my primary table stored orders, which has these fields User_ID,ID, Type,…
1 2
3
8 9