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

Riak 2i - list index values

Is it possible to list all secondary index values previously saved in Riak bucket (leveldb, 2i enabled)? Having the following data in Riak: curl -XPOST localhost:8098/types/indexes/buckets/users/keys/x -H 'x-riak-my_bin: a' curl -XPOST…
Pavel S.
  • 11,892
  • 18
  • 75
  • 113
0
votes
1 answer

How Apache Phoenix secondary indexing works

How secondary index works with Phoenix. I have an HBASE database setup, which is updated via direct insertion in HBASE and not via Phoenix insert queries. But all the select will be done via Phoenix select queries. Will Phoenix secondary indexes…
Saurabh
  • 71,488
  • 40
  • 181
  • 244
0
votes
1 answer

How to implement a scalable, unordered collection in DynamoDB?

I am looking into implementing a scalable unordered collection of objects on top of Amazon DynamoDB. So far the following options have been considered: Use DynamoDB document data types (map, list) and use document path to access stand-alone items.…
0
votes
1 answer

how to do intercept scan in hbase coprocessor

how can you intercept what is being queried in hbase? I saw that you can intercept preGetOp and preScannerOpen but I can't figure out to see what column families and column qualifiers are being queried. how do you see that? I am willing to write a…
Alex
  • 2,126
  • 3
  • 25
  • 47
0
votes
1 answer

how do multiple Cassandra secondary indices work?

As Cassandra does not have an execution plan, we were wondering how multiple secondary indices would work? i.e., if query was filtered by a different column order, which secondary index would get the preference and why? We do know they are a bad…
kisna
  • 2,869
  • 1
  • 25
  • 30
0
votes
1 answer

Riak: are my 2is broken?

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…
Matthias
  • 2,622
  • 1
  • 18
  • 29
0
votes
1 answer

riak: poll a bucket for all items in a bucket by secondary index

Trying to do this via the documentation at their site, but it appears to be outdated. Have a bucket with a secondary index, and want to curl it to get the JSON associated with all objects that have a certain value for a secondary index. Looks like…
fox
  • 15,428
  • 20
  • 55
  • 85
0
votes
0 answers

Write Riak Secondary Index via AJAX POST

I'm in need of fixing some 2i by hand in Riak 1.4+. I've installed rekon for a sake of use, and now I'm editing template. All I want to do is just add some $.ajax onclick like this: $.ajax({ url: $(pairUrl).attr('url'), type: "POST", headers: { …
0
votes
0 answers

cqlsh query on secondary indexed column rpc timeout

I am finding trouble in why my query in secondary indexed column in cassandra getting rpc timeout. Here is my details about the cassandra and table [cqlsh 4.1.1 | Cassandra 2.0.7 | CQL spec 3.1.1 | Thrift protocol…
Gagan
  • 4,278
  • 7
  • 46
  • 71
0
votes
1 answer

Cassandra : Can same secondary index be used in multiple keyspaces?

I am having 2 keyspaces. Keyspace 1 with say 10 tables and Keyspace 2 with additional tables apart from the ones in keyspace 1. So, Keyspace1 = column_family_1, column_family2 Keyspace2 = column_family_1,column_family_2,column_family_5 Suppose if I…
Poppy
  • 2,902
  • 14
  • 51
  • 75
0
votes
1 answer

Search by Query Expression in MongoDB

How do I search by a query expression in MongoDB? Something like Lastname+Firstname, where Lastname and Firstname are two separate fields? The search string would then be SmithJohn. Is this possible? Can I still take advantage of indexing? The…
Arlen Beiler
  • 15,336
  • 34
  • 92
  • 135
0
votes
1 answer

Does hbase 0.94.18 supports for secondary indexes?

I'm currently try to experience hbase to develop a hbase connector for a given project. so that I need to develop secondary indexing for that. so that I just need to know does hbase 0.94.18 supports for secondary indexes using coprocessors. Can…
Chamika Kasun
  • 96
  • 3
  • 16
0
votes
1 answer

Berkeley DB C++ query on floating index

Im using Berkeley DB C++ API 6.0 on OSX. My application creates a database with the following tables: Primary table: (int, myStruct) -> myStruct is a buffer. Secondary index: (float, myStruct) -> The float key is an information that I retrieve in…
0
votes
1 answer

Cassandra: Delete all secondary index in a keyspace using CQL

I am creating a batch job to flush all the data available in my keyspace. When I use the command DROP KEYSPACE , tables and data are getting cleared while the secondary index created for each table is not dropped. Is there a way to delete…
Poppy
  • 2,902
  • 14
  • 51
  • 75
0
votes
1 answer

rpc_timeout for a simple query on cassandra, using an index

here is the model, using cassandra 2.0, cql 3, and only one node : CREATE TABLE purchase ( row_id timeuuid, date text, domain_id text, item_id text, product_id text, purchase_id text, stream_id text, PRIMARY KEY (row_id) ) WITH …
tahir
  • 1,016
  • 1
  • 11
  • 21
1 2 3
8
9