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

CQL should prevent or warn about inefficient queries

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 1.2.0 beta 3
    • None
    • None

    Description

      When issuing a query like:

      CREATE TABLE videos (
        videoid uuid,
        videoname varchar,
        username varchar,
        description varchar,
        tags varchar,
        upload_date timestamp,
        PRIMARY KEY (videoid,videoname)
      );
      SELECT * FROM videos WHERE videoname = 'My funny cat';
      

      Cassandra samples some data using get_range_slice and then applies the query.

      This is very confusing to me, because as an end user am not sure if the query is fast because Cassandra is performing an optimized query (over an index, or using a slicePredicate) or if cassandra is simple sampling some random rows and returning me some results.

      My suggestions:
      1) force people to supply a LIMIT clause on any query that is going to
      page over get_range_slice
      2) having some type of explain support so I can establish if this
      query will work in the

      I will champion suggestion 1) because CQL has put itself in a rather unique un-sql like position by applying an automatic limit clause without the user asking for them. I also do not believe the CQL language should let the user issue queries that will not work as intended with "larger-then-auto-limit" size data sets.

      Attachments

        1. 0002-Allow-non-indexed-expr-with-ALLOW-FILTERING.txt
          8 kB
          Sylvain Lebresne
        2. 0001-4915.txt
          5 kB
          Sylvain Lebresne

        Activity

          People

            slebresne Sylvain Lebresne
            appodictic Edward Capriolo
            Sylvain Lebresne
            Jonathan Ellis
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: