'Does Global Index ( term-partitioned ) holds the whole row itself?
I'm reading book Designing Data Intensive Applications, currently on chapter about partitioning which describes secondary indexes where one example is local index (document-based partitioning) and global index which is term-partitioned. The picture below shows example of the global index.
The book says that global indexes perform better since index can be read from the single partition based on the "term". However what I don't get, is the index itself holding all rows that contain this term or following index read, next queries must be done to fetch data from all partitions that can contain the data? This would be little more efficient in comparison to local indexes where query must be send to all partitions, depending on the number of partitions.
In the summary of the chapter author wrote
Term-partitioned indexes (global indexes), where the secondary indexes are partitioned separately, using the indexed values. An entry in the secondary index may include records from all partitions of the primary key. When a document is written, several partitions of the secondary index need to be updated; however, a read can be served from a single partition.
Am I missing something here?
Solution 1:[1]
Following index read, next queries must be done to fetch data from all partitions that can contain the data
Yeah, I think that would be the case because storing the data alongside the index (clustered index) could lead to more painful consistency issues. In the worst-case, I agree that you would need to do a scatter-gather query similar to document-partitioning. But if your use case involves querying for a small amount of data that likely lives in a small subset of all your partitions, then a term-partitioned (global) index may be much better
References:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Tavish Gobindram |

