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

Allow CQL3 queries to do extra filter after getting the column slice on a composite primary key

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Low
    • Resolution: Duplicate
    • None
    • None
    • None

    Description

      Let the following work:

      CREATE TABLE "ChequeDeDup2" (
        "bucketId" int,
        "transitAba" int,
        "transitAccount" bigint,
        "serialNo" int,
        amount bigint,
        "subjectId" uuid,
        "channelInd" ascii,
        "creditAba" int,
        "creditAccount" bigint,
        "sourceTs" timestamp,
        PRIMARY KEY ("bucketId", "transitAba", "transitAccount", "serialNo", amount, "subjectId")
      )
      
      select * from "ChequeDeDup2" where "bucketId" = 198 and "transitAba" >= 101 and "transitAccount" = 198 and "serialNo" = 1 and "amount" = -1 order by "transitAba" desc , "transitAccount" desc, "serialNo" desc, amount desc, "subjectId" DESC limit 5;
      Bad Request: PRIMARY KEY part transitAccount cannot be restricted (preceding part transitAba is either not restricted or by a non-EQ relation)
      

      The assumption seems to be that it is better to serialize all the data with transitAba >= 198 back to the client side. But it is less efficient for the server to serialize all this data back to the client than it is to execute subsequent filters.

      The user should be allowed to trade off the CPU cost of filtering the data on the server side with the IO cost of serializing all that data.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jjordan Jeremiah Jordan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: