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

Batching SELECTs for multiple column ranges for the same partition key

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Normal
    • Resolution: Unresolved
    • None
    • Legacy/CQL
    • None

    Description

      SELECT’s IN clause allows to batch selects for multiple partition keys of a given table. Can we consider supporting batch select for multiple column ranges for a given partition key?

      For instance, would like to batch below two or more SELECTs for a given partition key “event_type” and the different ranges of the “time”:

      SELECT value
      FROM events
      WHERE event_type = 'myEvent'
      AND time > '2011-02-03'
      AND time <= '2012-01-01'

      SELECT value
      FROM events
      WHERE event_type = 'myEvent'
      AND time > '2012-02-03'
      AND time <= '2013-01-01’

      One way to optimize these is to fire multiple SELECTs in parallel & async from the application, but by batching them we can do further optimizations such as avoid multiple round trips; from app server to C*, and even from coordinator to the replicas. Once request is received by the target replicas, we can return all the ranges requested for a particular partition key in one shot.
      This will be very useful for some of the use cases we're working on. I can take a first cut at this if no concerns.

      In addition, how about supporting batch for multiple SELECTs across tables. I think that will require more changes in ResultSet and may not have lot of opportunities for optimizations. However, at least it will help to avoid multiple round trips from app server to the C*.

      Thoughts welcome. Thanks!

      Attachments

        Activity

          People

            Unassigned Unassigned
            pateljay3001 Jay Patel
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated: