Select as a part of the covering index

We have the following n1ql query
SELECT ctlgId FROM dvr-catalog where account = “value1” and canonId = “value2”
and the corresponded covering index
CREATE INDEX idx_account_canonId ON dvr-catalog(account,canonId)

Would it help to improve performance if we add ctlgId to the covering index, i.e.
CREATE INDEX idx_account_canonId2 ON dvr-catalog(account,canonId, ctlgId )

Thank you

Yes. idx_account_canonId is not covering index. The predicate only covered. Covered query means index has all the information query need and avoid document Fetch. ctlgId is not part of the index so it must do Fetch.

1 Like