Indexes on meta().id or type

Hi,

My documents have both a prefix in the document key and a property type indicating the document type. Should creating indexes on the type be more more efficient than using the meta().id?

CREATE INDEX some_idx ON some_bucket(x, y, z) WHERE META().id LIKE “documentType::%”;

OR

CREATE INDEX some_idx ON some_bucket(x, y, z) WHERE type = ‘documentType::’;

Thanks,

Keith

If you have type as separate field will recommend

CREATE INDEX some_idx ON some_bucket(x, y, z) WHERE type = ‘documentType::’;

LIKE is regular expression and query also need to use that which can be extra over head evaluation.

Thanks vsr1 for confirming this.

btw, It is a good practice to have at least one index per document type. https://developer.couchbase.com/resources/best-practice-guides/n1ql-tuning-guide.pdf