Querying key with wildcard seems slow

I’d like to do somthing like:
select META().id from mybucket where META().id like “blah%”;

This seems to be slow. I created a primary index, which helped, but
it’s still pretty slow. They couchbase logs make it seem like the n1ql
client is querying through every doc.

Is there an efficient way to query a key with a wildcard?

Hi,

Can you store the id as a field in the document? You can then create an index on the field.

We are aware that there’s an issue with wildcards and meta, and we plan to fix it.

Thanks.

The primary index covers this query now in the current product. Alternatively, you can also create an index on mybucket(meta().id) if you want to avoid unintentional primary scans.