Details
-
Bug
-
Resolution: Fixed
-
Critical
-
6.6.0, Cheshire-Cat
-
None
-
Untriaged
-
1
-
Unknown
Description
May be present from 5.5
Repro:
2 indexer nodes.
INSERT INTO default VALUES("f01", {"score":8.1}); |
INSERT INTO default VALUES("f02", {"score":8.2}); |
INSERT INTO default VALUES("f03", {"score":8.3}); |
INSERT INTO default VALUES("f04", {"score":9.3}); |
DROP INDEX default.ix11; |
CREATE INDEX `ix11` ON `default`(score DESC,c) PARTITION BY hash((meta().`id`)); |
select META(d).id, score, c FROM default AS d where d.score > 8 ORDER BY d.score desc; |
|
{
|
"#operator": "Sequence", |
"~children": [ |
{
|
"#operator": "IndexScan3", |
"as": "d", |
"covers": [ |
"cover ((`d`.`score`))", |
"cover ((`d`.`c`))", |
"cover ((meta(`d`).`id`))" |
],
|
"filter": "(8 < cover ((`d`.`score`)))", |
"index": "ix11", |
"index_id": "32af084a887521ec", |
"index_order": [ |
{
|
"desc": true, |
"keypos": 0 |
}
|
],
|
"keyspace": "default", |
"namespace": "default", |
"spans": [ |
{
|
"exact": true, |
"range": [ |
{
|
"inclusion": 0, |
"low": "8" |
}
|
]
|
}
|
],
|
"using": "gsi" |
}
|
index_order keypos 0 desc is not honored.
The repro has special situations. All the index keys and document key are required so index_projection is omitted (indexer project everything).
If we remove projection c or meta().id , query adds index_projection and it honors index order.
|
"index_projection": { |
"entry_keys": [ |
0 |
],
|
"primary_key": true |
}
|
|
|
|
Attachments
Issue Links
- backports to
-
MB-43764 [BP MB-42623+44147 to 6.6.2] - [CBSE] partition Index order is not honored when index projection include all keys + document key
-
- Closed
-
-
MB-44378 [BP MB-42623+44147 to 6.6.1] - [CBSE] partition Index order is not honored when index projection include all keys + document key
-
- Closed
-
For Gerrit Dashboard: MB-42623 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
144331,3 | MB-42623 Fix index scan special case for descending sort | unstable | indexing | Status: MERGED | +2 | +1 |
145462,1 | MB-44147 Fix panic from edge case of MB-42623 patch | unstable | indexing | Status: MERGED | +2 | +1 |
146221,1 | MB-43764 [BP MB-42623+44147 to 6.6.2] Fix descending sort edge case | mad-hatter | indexing | Status: MERGED | +2 | +1 |
146378,1 | MB-44378 [BP MB-42623+44147 to 6.6.1.MP2] Fix descending sort edge case | 6.6.1 | indexing | Status: MERGED | +2 | +1 |