Description
one of the element inside IN clause has query parameter we choose FULL_SPAN (we may not able to eliminate duplicates). If the query is rewritten as OR clause it uses precise spans.
If possible we should do same for IN.
create index ix1 on default(x);
|
explain select x from default where x in ["5", $1];
|
{
|
"#operator": "IndexScan",
|
"covers": [
|
"cover ((`default`.`x`))",
|
"cover ((meta(`default`).`id`))"
|
],
|
"index": "ix1",
|
"index_id": "bbbba8a92f99a",
|
"keyspace": "default",
|
"namespace": "default",
|
"spans": [
|
{
|
"Range": {
|
"Inclusion": 0,
|
"Low": [
|
"null"
|
]
|
}
|
}
|
],
|
"using": "gsi"
|
},
|
explain select x from default where x =5 OR x = $1 ;{
|
"#operator": "DistinctScan",
|
"scan": {
|
"#operator": "IndexScan",
|
"covers": [
|
"cover ((`default`.`x`))",
|
"cover ((meta(`default`).`id`))"
|
],
|
"index": "ix1",
|
"index_id": "bbbba8a92f99a",
|
"keyspace": "default",
|
"namespace": "default",
|
"spans": [
|
{
|
"Range": {
|
"High": [
|
"5"
|
],
|
"Inclusion": 3,
|
"Low": [
|
"5"
|
]
|
}
|
},
|
{
|
"Range": {
|
"High": [
|
"$1"
|
],
|
"Inclusion": 3,
|
"Low": [
|
"$1"
|
]
|
}
|
}
|
],
|
"using": "gsi"
|
}
|
},
|
|
Attachments
Issue Links
- blocks
-
MB-19612 4.5.1 Minor Release
- Closed