Description
This maybe in earlier versions as well, I've not tested.
CREATE INDEX ixCover on shellTest(f1, f2);
EXPLAIN SELECT f2, f3 FROM shellTest f2 WHERE f1=5;
gets this for index spans:
\{
|
"#operator": "IndexScan2", |
"index": "ixCover", |
"index_id": "59f63b0b4a477505", |
"index_projection": \{ |
"primary_key": true |
},
|
"keyspace": "shellTest", |
"namespace": "default", |
"spans": [ |
\{
|
"range": [ |
\{
|
"high": "5", |
"inclusion": 3, |
"low": "5" |
},
|
\{
|
"inclusion": 0, |
"low": "null" |
}
|
]
|
}
|
],
|
"using": "gsi" |
},
|
Notes two spans are generated although only a single filter is present. The span for key f2 is "> null" which excludes NULL values, which is not what the query asked for.
Similarly, this query:
EXPLAIN SELECT f2, f3 FROM shellTest f1 WHERE f2=5;
generates the following spans:
\{
|
"#operator": "IndexScan2", |
"index": "ixCover", |
"index_id": "59f63b0b4a477505", |
"index_projection": \{ |
"primary_key": true |
},
|
"keyspace": "shellTest", |
"namespace": "default", |
"spans": [ |
\{
|
"range": [ |
\{
|
"inclusion": 0, |
"low": "null" |
},
|
\{
|
"high": "5", |
"inclusion": 3, |
"low": "5" |
}
|
]
|
}
|
],
|
"using": "gsi" |
},
|
again two spans are generated from a single filter, this time excluding the NULL values on f1.
Attachments
Issue Links
- duplicates
-
MB-26740 Select query throwing the error "Duplicate variable v already in scope", since an index contains the variable v
- Closed