Slower to query set with 1 record than set with millions records

Hi!

I have a aerospike cluster (8nodes) that contain 2 sets. 1 set with ~100 millions records 1 set with 1 record.

The cluster get 600_000 reads per seconds. All made to the set with 100 millions records.

When I query something in this big set, it takes ~72ms on average. When I do the same query on the small set with 1 record, it takes ~2-3 seconds on average.

The query is a map read for a specific key. This query return nothing as the key doesn’t exist in both sets.

Is there any explanation of why it’s way slower to do the same query on a tiny set compared to a huge one?

Thanks!

By ‘query’ are you referring to a single get or to a scan (primary index query) or secondary index query?

Can you show how you are doing the query?

If a scan, you would have to go through the whole namespace… the time it takes to check all records in the namespace should be the same (unless if you have created a set index – see enable-index) and when going against the set with more records, it would likely fill up a buffer fast enough to give you the impression that it is faster when in fact it may not have completed the query yet but just got you the first buffer fast enough… but those are just guesses at this point based on the high level description.

1 Like