Hi there,
I have a question about the sg_channels_1 index that gets created when the Sync Gateway starts up. I have 61,469 documents in our data bucket, but the sg_channels_1 index that gets created shows it has indexed 105,530 items. I’m not super strong with the N1QL being used for the index so I’m not sure if this is normal. I would appreciate it if you could help me understand a bit more about why there are so many more items indexed compared to documents in the bucket.
Here is the index:
CREATE INDEX `sg_channels_1` ON `data`((all (array [(`op`.`name`), least(((self.`_sync`).`sequence`), ((`op`.`val`).`seq`)), ifmissing(((`op`.`val`).`rev`), null), ifmissing(((`op`.`val`).`del`), null)] for `op` in object_pairs(((self.`_sync`).`channels`)) end)),((self.`_sync`).`rev`),((self.`_sync`).`sequence`),((self.`_sync`).`flags`)) WITH { "defer_build":true }
This happens in our production environment which has many more documents/items, but the numbers I provided above is from my own development environment where I am seeing similar results. I’m not positive about our production environment cluster (I can get that info if it’s important). My development environment is a single server node with single Sync Gateway instance.
Couchbase Server: 6.5.0-4960
Sync Gateway: 2.5.0-271
Thank you for any assistance you can give me!