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

[n1ql ASC/DESC] Query is not using the same index consistenty.

    XMLWordPrintable

Details

    Description

      Indexes created:
      CREATE INDEX idx1 ON default(join_yr ASC, join_day DESC, VMs ASC)
      CREATE INDEX idx2 ON default(join_yr DESC, join_day DESC, meta().id DESC)

      Query issued:
      explain SELECT * FROM default WHERE join_yr > 10 ORDER BY join_yr, join_day DESC LIMIT 10 OFFSET 20

      This query uses idx1 mostly.

      But intermittently it uses idx2.

      Example document:
      {
      "tasks_points":

      { "task1": 1, "task2": 1 }

      ,
      "name": "employee-9",
      "mutated": 0,
      "skills": [
      "skill2010",
      "skill2011"
      ],
      "join_day": 9,
      "join_mo": 10,
      "email": "9-mail@couchbase.com",
      "test_rate": 10.1,
      "join_yr": 2011,
      "_id": "query-testemployee10153.1877827-0",
      "VMs": [

      { "RAM": 10, "os": "ubuntu", "name": "vm_10", "memory": 10 }

      ,

      { "RAM": 10, "os": "windows", "name": "vm_11", "memory": 10 }

      ],
      "job_title": "Engineer"
      }

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Sitaram.Vemulapalli Sitaram Vemulapalli
              Prerna.Manaktala Prerna Manaktala (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty