I am working with Couchbase 6.0. I know that we can create Secondary index on a filter.
So I have created a index like
CREATE INDEX idx_zipcode
ON userbucket(zipcode)
WHERE status = "active";
I have a question here:
Can I create an index on a filter clause if field is dynamic.
Something like this
CREATE INDEX idx_zipcode
ON userbucket(zipcode)
WHERE status = ? ;
Second question is,
which one is better in terms of performance:
Single index on 2 fields
CREATE INDEX idx_1 ON userbucket('fname','lname')
or
Separate Index on each field
CREATE INDEX idx_1 ON userbucket('fname')
CREATE INDEX idx_2 ON userbucket('lname')