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

          For Gerrit Dashboard: MB-37078
          # Subject Branch Project Status CR V

          Activity

            evgeny.makarenko Evgeny Makarenko (Inactive) created issue -
            jeelan.poola Jeelan Poola made changes -
            Field Original Value New Value
            Component/s indexing [ 15110 ]
            Sitaram.Vemulapalli Sitaram Vemulapalli made changes -
            Fix Version/s Mad-Hatter [ 15037 ]
            Sitaram.Vemulapalli Sitaram Vemulapalli made changes -
            Attachment aa.sql [ 78410 ]
            Sitaram.Vemulapalli Sitaram Vemulapalli made changes -
            Component/s secondary-index [ 11211 ]
            Component/s query [ 10718 ]
            Sitaram.Vemulapalli Sitaram Vemulapalli made changes -
            Assignee Kamini Jagtiani [ kamini.jagtiani ] Jeelan Poola [ jeelan.poola ]
            Sitaram.Vemulapalli Sitaram Vemulapalli made changes -
            Is this a Regression? Unknown [ 10452 ] Yes [ 10450 ]
            jeelan.poola Jeelan Poola made changes -
            Assignee Jeelan Poola [ jeelan.poola ] Amit Kulkarni [ amit.kulkarni ]
            lynn.straus Lynn Straus made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            amit.kulkarni Amit Kulkarni made changes -
            Attachment ExplainAlice.txt [ 78446 ]
            Attachment ExplainMH.txt [ 78447 ]
            lynn.straus Lynn Straus made changes -
            Labels approved-for-mad-hatter
            lynn.straus Lynn Straus made changes -
            Due Date 05/Dec/19
            lynn.straus Lynn Straus made changes -
            Link This issue blocks MB-36676 [ MB-36676 ]
            amit.kulkarni Amit Kulkarni made changes -
            VERIFICATION STEPS QE Testing:

            Various scenarios around MIN aggregate queries (with index on multiple composite keys and multiple different filter values specified for each composite key).
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]
            evgeny.makarenko Evgeny Makarenko (Inactive) made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            amit.kulkarni Amit Kulkarni made changes -
            Link This issue is cloned by MB-37274 [ MB-37274 ]

            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