In our application, the value of the document key has format like the following:
<development environment ID>::<document type>::<UUID>
We have tried to use query like the following to get documents for a particular environment and document type like the following:
select * from travel WHERE META().id LIKE “dev1::airline::%”
We want to find all airline documents for a given development environment dev1. We noticed that the above query will use the primary index and perform very slow.
Another option we have is we can create additional fields on the documents which can store the value of development environment, and create index on the document type and development environment, then create query based on these two fields. However, we prefer to create as few index as possible. Since the environment and document type are already part of the document key, i am just wondering whether there are other ways to query the information and avoid the primary index scan. Thanks