Item count is very high

Transferring a question from a github ticket, from user DayronIG:

“That the bucket containing the database has a count item very high , for example I have 10 documents , but in the bucket containing the syncgateway appear 1500 item counts in the bucket , and synchronize 10 documents too you delay .
What am I doing wrong.
Thank you”

The database bucket includes information used for user management and replication - if you’ve had many users replicating against this database, you might expect several additional documents per user (for user record, session, local checkpoint, etc.)

Another possibility would be deleted documents - deleted documents are retained (with the _deleted property set) in order to support replication of the delete to clients.

In any case, I wouldn’t expect that many documents (1500) to be causing any kind of delays in replication. If you can provide some more details on what types of documents you’re seeing in the bucket, and what kind of delays you’re experiencing, we might be able to provide more information.

Hello Adam, thank you for your quick reply! I’m working with Dayron in the same project, this project is a salesforce app that changes entire catalog every one or two months so our client deletes like 20.000 sku´s and inserts another 20.000 so every time this happens all devices replicates this info and that´s ok, but when a new tablet is synchronising sync gateway(in it´s logs) shows like it were deleting documents during this replication, that´s why I think that could be slowing down the replication times, is there any way that when I’m sure that all devices(luckily that this would be possible in this project) have deleted the documents that are no necessary anymore, clean in some way the sync(with shadowing) database?

Thanks again,