Details
-
Bug
-
Resolution: Fixed
-
Critical
-
6.5.0
-
Untriaged
-
Centos 64-bit
-
Yes
Description
Build 6.5.0-4219
Having index:
CREATE INDEX `ix3` ON `default`((distinct (array (`a`.`y`) for `a` in `arr` end)) DESC) |
and running query
EXPLAIN SELECT COUNT(DISTINCT a.y) FROM default d UNNEST d.arr As a WHERE a.y = 10 |
expect to find aggregate pushdown in execution plan, but it is missed:
[
|
{
|
"plan": { |
"#operator": "Sequence", |
"~children": [ |
{
|
"#operator": "IndexScan3", |
"as": "d", |
"covers": [ |
"cover ((`a`.`y`))", |
"cover ((meta(`d`).`id`))" |
],
|
"filter_covers": { |
"cover (((`d`.`arr`) < {}))": true, |
"cover (([] <= (`d`.`arr`)))": true, |
"cover (is_array((`d`.`arr`)))": true |
},
|
"index": "ix3", |
"index_id": "6644faca9b73ead8", |
"keyspace": "default", |
"namespace": "default", |
"spans": [ |
{
|
"exact": true, |
"range": [ |
{
|
"high": "10", |
"inclusion": 3, |
"low": "10" |
}
|
]
|
}
|
],
|
"using": "gsi" |
},
|
{
|
"#operator": "Parallel", |
"~child": { |
"#operator": "Sequence", |
"~children": [ |
{
|
"#operator": "Filter", |
"condition": "(cover ((`a`.`y`)) = 10)" |
},
|
{
|
"#operator": "InitialGroup", |
"aggregates": [ |
"count(distinct cover ((`a`.`y`)))" |
],
|
"group_keys": [] |
}
|
]
|
}
|
},
|
{
|
"#operator": "IntermediateGroup", |
"aggregates": [ |
"count(distinct cover ((`a`.`y`)))" |
],
|
"group_keys": [] |
},
|
{
|
"#operator": "FinalGroup", |
"aggregates": [ |
"count(distinct cover ((`a`.`y`)))" |
],
|
"group_keys": [] |
},
|
{
|
"#operator": "Parallel", |
"~child": { |
"#operator": "Sequence", |
"~children": [ |
{
|
"#operator": "InitialProject", |
"result_terms": [ |
{
|
"expr": "count(distinct cover ((`a`.`y`)))" |
}
|
]
|
},
|
{
|
"#operator": "FinalProject" |
}
|
]
|
}
|
}
|
]
|
},
|
"text": "SELECT COUNT(DISTINCT a.y) FROM default d UNNEST d.arr As a WHERE a.y = 10" |
}
|
]
|