Skip to content

Commit b16fd5e

Browse files
Avoid reading PrimaryKey from disk by using PrimaryKeyWithSource
[java] Result "org.apache.cassandra.test.microbench.index.sai.NEQQueryBench.queryNEQ": [java] 17761666.739 ±(99.9%) 260418.205 ns/op [Average] [java] (min, avg, max) = (17644295.340, 17761666.739, 18241636.689), stdev = 172250.519 [java] CI (99.9%): [17501248.533, 18022084.944] (assumes normal distribution) [java] [java] [java] # Run complete. Total time: 00:07:36 [java] [java] REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on [java] why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial [java] experiments, perform baseline and negative tests that provide experimental control, make sure [java] the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts. [java] Do not assume the numbers tell you what you want them to tell. [java] [java] Benchmark (numRowsWithinPartition) Mode Cnt Score Error Units [java] NEQQueryBench.queryNEQ 1000 avgt 10 2169861.695 ± 11355.830 ns/op [java] NEQQueryBench.queryNEQ 10000 avgt 10 17761666.739 ± 260418.205 ns/op
1 parent 795a4ef commit b16fd5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/java/org/apache/cassandra/index/sai/disk/PrimaryKeyMapIterator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ protected PrimaryKey computeNext()
110110
{
111111
while (currentRowId >= 0 && currentRowId < keys.count())
112112
{
113-
PrimaryKey key = keys.primaryKeyFromRowId(currentRowId++);
113+
PrimaryKey key = keys.primaryKeyFromRowId(currentRowId++, getMinimum(), getMaximum());
114114
if (filter == KeyFilter.KEYS_WITH_CLUSTERING && key.hasEmptyClustering())
115115
continue;
116116
return key;

0 commit comments

Comments
 (0)