cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacques-Henri Berthemet <>
Subject RE: SASI and secondary index simultaniously
Date Wed, 12 Jul 2017 08:40:21 GMT

According to SASI source code (3.11.0) it will always have priority over regular secondary

    public long getEstimatedResultRows()


        // this is temporary (until proper QueryPlan is integrated into Cassandra)

        // and allows us to priority SASI indexes if any in the query since they

        // are going to be more efficient, to query and intersect, than built-in indexes.

        return Long.MIN_VALUE;


I see that index building progress is reported as a CompactionInfo task so you should be able
to monitor progress using ‘nodetool compactionstats’. Last point, from the moment that
SASI index is created it will be used over regular index so I think you could drop the regular
as soon as it is created it will make no difference. It also means that you may miss results
until it is fully built.

Note that I may be wrong, I’m just reading sources as I’m working on a custom index.

Jacques-Henri Berthemet

From: Vlad []
Sent: mercredi 12 juillet 2017 08:56
To: User <>
Subject: SASI and secondary index simultaniously


it's possible to create both regular secondary index and SASI on the same column:

CREATE TABLE ks.tb (id int PRIMARY KEY,  name text);
CREATE CUSTOM INDEX tb_name_idx_1 ON ks.tb (name) USING 'org.apache.cassandra.index.sasi.SASIIndex';
CREATE INDEX tb_name_idx ON ks.tb (name);
But which one is used for SELECT? Assuming we have regular index and would like to migrate
to SASI, can we first create SASI, than drop regular? And how can we check then index build
is completed?


View raw message