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

Query can result in wrong when index key is DNF transformed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • bug-backlog
    • 6.5.1, Cheshire-Cat
    • query
    • None
    • Untriaged
    • 1
    • Unknown

    Description

      CREATE INDEX `ix1` ON `default`(ISSTRING(name)) WHERE ISSTRING(name);
      INSERT INTO default VALUES("k01",{"name":"abc"});
      select 1 from default USE INDEX (ix1) where ISSTRING(name) = true and ISSTRING(name);
      

      returns 0 results.
      Reason is "index_projection": {},
      This happens due to ISSTRING(name) index key is DNF transformed but actual query never DNF transformed so could not decide if the expression is index key dependent.

      select count(1) from default where ISSTRING(name)=true AND ISSTRING(name) ;
      not using index aggregates and also gives wrong results

      Attachments

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

        Activity

          People

            gaurav.jayaraj Gaurav Jayaraj
            Sitaram.Vemulapalli Sitaram Vemulapalli
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty