Details
-
Bug
-
Resolution: Fixed
-
Major
-
7.6.0, 7.2.4, 7.1.6
-
Untriaged
-
0
-
Unknown
Description
Repro:
ADVISE SELECT META(b).id
|
FROM default b UNNEST b.arr1 AS a
|
WHERE
|
b.c1 = "green"
|
AND NOT (a.c2 = "abc" AND a.c3 = "abc")
|
;
|
This generates:
{
|
"#operator": "Advise",
|
"advice": {
|
"#operator": "IndexAdvice",
|
"adviseinfo": {
|
"recommended_indexes": {
|
"indexes": [
|
{
|
"index_statement": "CREATE INDEX adv_c1_ALL_arr1_c3_ALL_arr1_c2 ON `default`(`c1`,ALL ARRAY `a`.`c3` FOR a IN `arr1` END,ALL ARRAY `a`.`c2` FOR a IN `arr1` END)",
|
"keyspace_alias": "default_b",
|
"recommending_rule": "Index keys follow order of predicate types: 1. Common leading key for disjunction (2. equality/null/missing), 1. leading array index for unnest."
|
},
|
{
|
"index_statement": "CREATE INDEX adv_ALL_arr1_c3_c1 ON `default`(ALL ARRAY `a`.`c3` FOR a IN `arr1` END,`c1`)",
|
"keyspace_alias": "default_b",
|
"recommending_rule": "Index keys follow order of predicate types: 1. leading array index for unnest, 2. equality/null/missing."
|
}
|
]
|
}
|
}
|
},
|
"query": "SELECT META(b).id FROM default b UNNEST b.arr1 AS a WHERE b.c1 = \"green\" AND NOT (a.c2 = \"abc\" AND a.c3 = \"abc\");"
|
}
|
Note that the first index recommendation is invalid since it contains multiple array index keys.
Attachments
Issue Links
- relates to
-
MB-50565 index advisor suggests invalid index when query has multiple array expressions
- Closed
For Gerrit Dashboard: MB-60572 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
204633,2 | MB-60572 Proper detection of multiple array index keys in index advisor | 7.6.0 | query-ee | Status: MERGED | +2 | +1 |
204701,2 | MB-60572 Modification of previous fix | 7.6.0 | query-ee | Status: MERGED | +2 | +1 |
204704,2 | MB-60572 Proper detection of multiple array index keys in index advisor | neo | query-ee | Status: MERGED | +2 | +1 |
204705,2 | MB-60572 Fix neo build | neo | query | Status: MERGED | +2 | +1 |