You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Yash Sunil Nasery (Jira)" <ji...@apache.org> on 2026/04/14 04:17:00 UTC

[jira] [Comment Edited] (CASSANDRA-18216) Allow sharding of the SAI in-memory index

    [ https://issues.apache.org/jira/browse/CASSANDRA-18216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18073341#comment-18073341 ] 

Yash Sunil Nasery edited comment on CASSANDRA-18216 at 4/14/26 4:16 AM:
------------------------------------------------------------------------

Ran a JMH benchmark on the WIP work that [~maedhroz] just linked in his comment ( The WIP is in my personal fork for the moment ). We have promising numbers on the frontend writes at least. Roughly a 1.8x to 2x write throughput gain there. The rows per partition below is just to determine the number of primaryKeys we have. We are iterating on the benchmark to get more solid numbers.

*Note:* Numbers are from a 8-core, 16gb ram, ARM M3 mac.
{code:java}
     [java] Benchmark                      (numberOfTerms)  (rowsPerPartition)  (shardCount)   Mode  Cnt     Score     Error   Units
     [java] MemtableIndexWriteBench.write          1000000                   1             1  thrpt    5   736.844 ± 161.779  ops/ms
     [java] MemtableIndexWriteBench.write          1000000                   1             4  thrpt    5  1242.385 ± 215.068  ops/ms
     [java] MemtableIndexWriteBench.write          1000000                   1             8  thrpt    5  1413.289 ± 208.818  ops/ms
     [java] MemtableIndexWriteBench.write          1000000                  10             1  thrpt    5   788.259 ±  16.962  ops/ms
     [java] MemtableIndexWriteBench.write          1000000                  10             4  thrpt    5  1197.192 ± 137.359  ops/ms
     [java] MemtableIndexWriteBench.write          1000000                  10             8  thrpt    5  1471.485 ± 273.985  ops/ms
     [java] MemtableIndexWriteBench.write          1000000                 100             1  thrpt    5   858.889 ±  81.941  ops/ms
     [java] MemtableIndexWriteBench.write          1000000                 100             4  thrpt    5  1228.520 ±  74.003  ops/ms
     [java] MemtableIndexWriteBench.write          1000000                 100             8  thrpt    5  1480.443 ± 190.490  ops/ms {code}


was (Author: naseryyash):
Ran a JMH benchmark on the WIP work that [~maedhroz] just linked in his comment ( The WIP is in my personal fork for the moment ). We have promising numbers on the frontend writes at least. Roughly a 1.8x to 2x write throughput gain there. The rows per partition below is just to determine the number of primaryKeys we have. We are iterating on the benchmark to get more solid numbers.


{code:java}
     [java] Benchmark                      (numberOfTerms)  (rowsPerPartition)  (shardCount)   Mode  Cnt     Score     Error   Units
     [java] MemtableIndexWriteBench.write          1000000                   1             1  thrpt    5   736.844 ± 161.779  ops/ms
     [java] MemtableIndexWriteBench.write          1000000                   1             4  thrpt    5  1242.385 ± 215.068  ops/ms
     [java] MemtableIndexWriteBench.write          1000000                   1             8  thrpt    5  1413.289 ± 208.818  ops/ms
     [java] MemtableIndexWriteBench.write          1000000                  10             1  thrpt    5   788.259 ±  16.962  ops/ms
     [java] MemtableIndexWriteBench.write          1000000                  10             4  thrpt    5  1197.192 ± 137.359  ops/ms
     [java] MemtableIndexWriteBench.write          1000000                  10             8  thrpt    5  1471.485 ± 273.985  ops/ms
     [java] MemtableIndexWriteBench.write          1000000                 100             1  thrpt    5   858.889 ±  81.941  ops/ms
     [java] MemtableIndexWriteBench.write          1000000                 100             4  thrpt    5  1228.520 ±  74.003  ops/ms
     [java] MemtableIndexWriteBench.write          1000000                 100             8  thrpt    5  1480.443 ± 190.490  ops/ms {code}

> Allow sharding of the SAI in-memory index 
> ------------------------------------------
>
>                 Key: CASSANDRA-18216
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18216
>             Project: Apache Cassandra
>          Issue Type: Improvement
>          Components: Feature/SAI
>            Reporter: Mike Adamson
>            Assignee: Yash Sunil Nasery
>            Priority: Normal
>              Labels: SAI
>             Fix For: 6.x
>
>
> The Memtable implementation allows it to be split into a number of shards. This reduces contention during writes. 
> The MemtableIndex in SAI should follow this practice. It currently does not support sharding so all writes hit the same synchronized write block. The in-memory index search can also use the sharding to reduce the number of indexes that it searches based on the key range passed to the search.
> This exists already in the DS fork: https://github.com/datastax/cassandra/pull/298



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org