Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-11954

Generalize SASI indexes

    XMLWordPrintableJSON

    Details

      Description

      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:

      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))');
      

      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?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              adelapena Andres de la Peña
            • Votes:
              1 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

              • Created:
                Updated: