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

More than one key sargable, but first key generates empty span it panics

    XMLWordPrintable

Details

    • Untriaged
    • 1
    • Yes

    Description

       create index ix1 ON default(DISTINCT ARRAY v.id FOR v IN arr1 END, c1);
      EXPLAIN SELECT 1 FROM default WHERE ANY v IN arr1 SATISFIES v.id IN [] END AND c1 = 5;
      
      

      2021-09-21T17:12:36.138-07:00 [SEVERE] request text: <ud>EXPLAIN SELECT 1 FROM default WHERE ANY v IN arr1 SATISFIES v.id IN [] END AND c1 = 5;</ud>
      2021-09-21T17:12:36.138-07:00 [SEVERE] query context: <ud></ud>
      2021-09-21T17:12:36.138-07:00 [SEVERE] stack: goroutine 350 [running]:
      github.com/couchbase/query/server.(*Server).serviceRequest.func1(0x5ba83c0, 0xc000d16000, 0xc0005f0000)
      	/Users/sitaram/trans/query/src/github.com/couchbase/query/server/server.go:924 +0xbe
      panic(0x5687860, 0xc00117e1e0)
      	/usr/local/Cellar/go/1.13.7/libexec/src/runtime/panic.go:679 +0x1b2
      github.com/couchbase/query/planner.SargForFilters(0xc000c05ab0, 0x2, 0x2, 0xc001133020, 0x2, 0x2, 0x2, 0xa800000, 0xc000aea0c0, 0xc0011629f0, ...)
      	/Users/sitaram/trans/query/src/github.com/couchbase/query/planner/sarg.go:115 +0xa8c
      github.com/couchbase/query/planner.(*builder).sargIndexes(0xc001166000, 0xc000aea0c0, 0xc001178f00, 0xc001178f28, 0x6d77260, 0xc001178b00)
      	/Users/sitaram/trans/query/src/github.com/couchbase/query/planner/build_scan_secondary.go:673 +0x769
      github.com/couchbase/query/planner.(*builder).buildCoveringScan(0xc001166000, 0xc001163380, 0xc001128300, 0xc000aea0c0, 0x5b72fa0, 0xc000578f50, 0x0, 0x0, 0x0, 0x0, ...)
      	/Users/sitaram/trans/query/src/github.com/couchbase/query/planner/build_scan_covering.go:102 +0xa75
      github.com/couchbase/query/planner.(*builder).buildCovering(0xc001166000, 0xc001163380, 0x0, 0xc001128300, 0xc000aea0c0, 0x5b72fa0, 0xc000578f50, 0x0, 0x0, 0x0, ...)
      	/Users/sitaram/trans/query/src/github.com/couchbase/query/planner/build_scan_covering.go:36 +0x104
      github.com/couchbase/query/planner.(*builder).buildSecondaryScan(0xc001166000, 0xc001163380, 0x0, 0xc001128300, 0xc000aea0c0, 0x5b72fa0, 0xc000578f50, 0x0, 0x0, 0x0, ...)
      	/Users/sitaram/trans/query/src/github.com/couchbase/query/planner/build_scan_secondary.go:29 +0xb8
      github.com/couchbase/query/planner.(*builder).buildTermScan(0xc001166000, 0xc001128300, 0xc000aea0c0, 0x5b72fa0, 0xc000578f50, 0xc0011c8000, 0x5, 0x100, 0xc000c05b60, 0x1, ...)
      	/Users/sitaram/trans/query/src/github.com/couchbase/query/planner/build_scan.go:407 +0x69d
      github.com/couchbase/query/planner.(*builder).buildSubsetScan(0xc001166000, 0x5b57b40, 0xc000c7cf70, 0xc001128300, 0xc000aea0c0, 0x5b72fa0, 0xc000578f50, 0xc0011c8000, 0x5, 0x100, ...)
      

      Attachments

        Issue Links

          Activity

            People

              pierre.regazzoni Pierre Regazzoni
              Sitaram.Vemulapalli Sitaram Vemulapalli
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty