Hi,

According to SASI source code (3.11.0) it will always have priority over 
regular secondary index:
https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/index/sasi/SASIIndex.java#L234






    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 [mailto:qa23d-...@yahoo.com.INVALID]
Sent: mercredi 12 juillet 2017 08:56
To: User cassandra.apache.org <user@cassandra.apache.org>
Subject: SASI and secondary index simultaniously

Hi,

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?

Thanks.


Reply via email to