Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-29725

Agg query with filter runs slower than without filter

    XMLWordPrintable

Details

    Description

      Query:

      SELECT COUNT(*) from reviews
      where stars > 4
      group by stars;
      

      is running slower than

      SELECT COUNT(*) from reviews
      group by stars;
      

      --------------------------

      Cluster: 2 nodes

      Node 1: KV, Analytics, Node 2: KV, Analytics

      setup: 

      1. YELP reviews dataset

      CREATE BUCKET YELP WITH \{"name":"YELP"}; 
      CREATE SHADOW DATASET reviews ON YELP WHERE `type` = "review";
      connect BUCKET YELP;
      

      – then ingest ~120M docs into KV

      – create indexes

      create index r_user_id on reviews(user_id:STRING);
      create index r_stars on review(stars:STRING);
      

      Attachments

        1. agg.sql
          2 kB
        2. agg-filter.sql
          3 kB
        3. not-covering.sql
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ali.alsuliman Ali Alsuliman
            tai.tran Tai Tran (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty