We’ve got the following index:
CREATE INDEX `my_idx`
ON `data1` ((split((meta().`id`),"::")[0]), `id`, `col1`, `col2`, `col3`, `col4`, `col5`, `col6`)
WHERE (((split((meta().`id`), "::")[1]) = "message")
AND ((split((meta().`id`), "::")[2]) = "type"))
We have the following query:
SELECT `id`, `col1`, `col2`, `col3`, `col4`, `col5`, `col6`
FROM `data1` WHERE split(meta().id, "::")[0] = "prefix"
AND split(meta().id, "::")[1] = "message"
AND split(meta().id, "::")[2] = "type"
When we make the query from console, it works fine (returns results)
When we make the query from code, adhoc = true
, works fine (return results)
When we make the query from code, adhoc = false
, does not work (NO RESULTS)
When making a similar query, but with SELECT *
, it works with adhoc = false
We, btw, do not permit primary indexes.