Capacity Planning - indexes

primary
index
secondary

#1

When doing a memory calculation for indexes, are both primary and secondary records used in the calculation on a given node, or just primary records?

https://www.aerospike.com/docs/operations/plan/capacity/

Thanks, Douglas


#2

There is a section for calculating size of primary index and another section for calculating size of secondary indexes.

You would need to calculate both.


#3

My question is are secondary records indexed in the primary and secondary indexes.

So for parameter R in the secondary index calculation (R - number of records/objects indexed in the secondary index). Is it all the records on the node, or is it just the primary records on the node.

From looking at the stats for the namespace it looks like the primary index takes up space for both primary and secondary records, whereas the secondary indexes seem to only contain primary records.


#4

The primary index is an index on all records in a namespace. Records indexed by a secondary index will be a subset of the primary index.


#5

I’m now good on the behaviour of primary indexes.

For secondary indexes. If you have a Set in a namespace that has a replication factor of 2, meaning roughly half the records will be considered primary for a given DB instance, and the other half will be secondary records. If all records in that set have a value for an indexed bin. Will both the primary and secondary records be indexed on that DB instance. Or will only the records the node considers primary be indexed.


#6

Both copies are indexed by secondary indexes.


#7

Thanks. The reason why I asked that was that I am always seeing a value that is significantly below the average calculation for a secondary string index (when I do stat namespace in aql).


#8

Which value? Could you provide output?