Andrés de la Peña created CASSANDRA-11954:
---------------------------------------------

             Summary: Generalize SASI indexes
                 Key: CASSANDRA-11954
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11954
             Project: Cassandra
          Issue Type: Improvement
          Components: Local Write-Read Paths, sasi
            Reporter: Andrés de la Peña
            Priority: Minor
             Fix For: 3.x


It would be great to independize SASI indexes from their underlying index 
structure and query syntax. This way it would be easy to create new custom 
SSTable attached index implementations for specific use cases. 

The API could consist on two of interfaces, one for on-memory indexes and other 
for on-disk indexes, implemented by users and invoked by Cassandra when there 
are row writes, SSTable flushes, compactions, etc.

As an example, the API could be used to build an efficient SASI geospatial 
index based on R-trees:
{code}
CREATE TABLE locations (
    id text,
    date timeuuid,
    location tuple<double, double>,
    PRIMARY KEY (id, date)
);

CREATE CUSTOM INDEX idx ON locations () USING '...' WITH OPTIONS = {...};

INSERT INTO locations (id, date, location) VALUES ('alice', now(), (-0.18676, 
51.66870));

SELECT * FROM locations WHERE expr(idx, 'POLYGON((-0.25 51.76, -0.25 51.54, 
-0.027 51.65, -0.25 51.76))');
{code}
Also, custom SASI indexes predicates could be combined with regular SASI 
indexes predicates in the same query, which would be very nice.

What do you think? Does it make any sense?





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to