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

Query: Different results for different indexes in use.

    XMLWordPrintable

Details

    Description

      Build 6.5.0-4890

      query 

      SELECT MIN(d.age) from default d USE INDEX (`travel_history_name_age`) UNNEST d.`travel_history` AS t where t = 'India'

      returns 45

      query

      SELECT MIN(d.age) from default d USE INDEX (`#primary`) UNNEST d.`travel_history` AS t where t = 'India'
      
      

      returns 28

      Indexes definitions:

      CREATE PRIMARY INDEX `#primary` ON `default`
       
      CREATE INDEX `name_age_travel_history` ON `default`(`name`,`age`,(all (array `t` for `t` in `travel_history` end)))
       
      CREATE INDEX `name_travel_history_age` ON `default`(`name`,(all (array `t` for `t` in `travel_history` end)),`age`)
       
      CREATE INDEX `travel_history_name_age` ON `default`((all (array `t` for `t` in `travel_history` end)),`name`,`age`)
      

      default bucket data is attached

      logs are attached

      Attachments

        1. aa.sql
          10 kB
        2. default_data.json
          111 kB
        3. ExplainAlice.txt
          2 kB
        4. ExplainMH.txt
          3 kB

        Issue Links

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

          Activity

            There are no commits yet on this issue.

            People

              amit.kulkarni Amit Kulkarni
              evgeny.makarenko Evgeny Makarenko (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty