Thank you in advance for the help.
We were using 4.5.1 CE. We have a few document like below.
{
" refId":“123”
“entries”: [1234567890, 1234567891, 1234567892]
“_class”: “some.package.Class”,
“creationTime”: 1234567890,
}
I had a index to get the documents in the ascending order of the entries.
CREATE INDEX entryIndex
ON entry-data
(distinct (array (i
) for i
in entries
end),refId
,creationTime
) WHERE (_class
= “com.package.Class”) USING GSI;
My Query is
select refId, creationTime from entry-data
b USE INDEX (entryIndex
) where _class = ‘com.package.Class’
and any i in dates satisfies i >= 1234567890 and i <= 1234567892 end and any id in dates satisfies id >= 1234567891
and id >= 1234567896 end offset 0 limit 100
In 4.5.1 we were getting the result in the index order. So we didn’t specifyied order by.
So when we upgrade to 6.0.0, the same index and query returning the result without any order. Result is getting shuffled. Is there any implementation logic changed in 6.0.0.
When I query with order by entries
, It returns correct order always. Should we use this? Please suggest
Tried query:
select refId, creationTime from entry-data
b USE INDEX (entryIndex
) where _class = ‘com.package.Class’
and any i in dates satisfies i >= 1234567890 and i <= 1234567892 end and any id in dates satisfies id >= 1234567891
and id >= 1234567896 end order by entries offset 0 limit 100