I have created an adaptive index on a bucket Binaries and 4 attributes as mentioned below in the query:
CREATE INDEX adap_idx1 ON Binaries(DISTINCT PAIRS({_id,_type,territory,type}))
WHERE _type = “ChecklistMetadata”;
But somehow this index is not getting used while querying.
Previously, we had individual indexes for all the above attributes. For instance: CREATE INDEX idx_id ON Binaries(_id) where _type=“ChecklistMetadata”;
Currently, we are trying to club all the index using adaptive index syntax, but we are failing to do so.
Please let is know whats the issue with the adaptive index we are creating. And what changes is required to make that work.
Even when we are creating index separately for _id where _type=“ChecklistMetadata”:
CREATE INDEX adap_idx_id1 ON Binaries(DISTINCT PAIRS(_id)) WHERE _type = “ChecklistMetadata”;
Then also we are facing the same problem. Its not able to fetch the result.
Please suggest when to use adaptive index and if we cant use in this case then why?
CREATE INDEX `adap_idx_id1` ON `Binaries` (DISTINCT PAIRS({_id,_type})) WHERE _type = "ChecklistMetadata";
select * from Binaries where _id="1678990" AND _type = "ChecklistMetadata" limit 10;