Hi @Heremeus ,
CREATE INDEX ix1 ON mybucket(`key`,version);
SELECT b.`key` , docid
FROM mybucket AS b
WHERE b.`key` IS NOT NULL
GROUP BY b.`key`
LETTING docid = MAX([b.version,META(b).id])[1]
Hi @Heremeus ,
CREATE INDEX ix1 ON mybucket(`key`,version);
SELECT b.`key` , docid
FROM mybucket AS b
WHERE b.`key` IS NOT NULL
GROUP BY b.`key`
LETTING docid = MAX([b.version,META(b).id])[1]