Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_all_docs still slow #440

Closed
jnordberg opened this issue Oct 7, 2014 · 6 comments
Closed

_all_docs still slow #440

jnordberg opened this issue Oct 7, 2014 · 6 comments

Comments

@jnordberg
Copy link
Contributor

Refs #326

On a bucket with 1 742 612 items fetching _all_docs logged in as a user who has 1 channel with 10 documents in it takes more than 60 seconds (our LB cuts the request off at that point so I'm unable to see the response, if there is any).

Requesting _changes?since=0 as the same user on the same bucket only takes ~20ms.

@jnordberg
Copy link
Contributor Author

Using Couchbase Sync Gateway/1.0.2-9(commit 95ef60ab)

@tleyden
Copy link
Contributor

tleyden commented Oct 9, 2014

@lichenyang2 assigning to you for now -- are there any performance tests that cover this?

@amazkovoi
Copy link

Hi Guys,

My name is Anton Mazkovoi and I have recently joined SafetyCulture, the company for whom jnordberg raised this issue.

We are now using Sync Gateway 1.0.3, but fetching _all_docs is still very slow.

Would you be able to indicate whether this is something you are planning to fix in the short term? An ETA for this would greatly help us understand when we can take Sync Gateway into production.

Cheers,
Anton

@ajres
Copy link

ajres commented Nov 7, 2014

@amazkovoi, this is the next ticket in my current sprint.

Initial review suggests the issue is that the _all_docs, passes every document in the underlying bucket through a channel filter for the calling user. Whereas the _changes feed gets the channels for the user and then retrieves the revisions only in those channels.

Since the most common use cases will have each user only see a small subset of the documents in a bucket, _all_docs performance would probably be faster if we take a similar approach to the _changes feed.

Andy

@amazkovoi
Copy link

Hi Andy,

That's great news! Thank you!!!

You are absolutely right. We find that each user has access to only a subset of documents, so getting _all_docs to use a similar approach to _changes makes a lot of sense.

Cheers,
Anton

@ajres
Copy link

ajres commented Jan 23, 2015

For authenticated users on the public API, _all_docs will now generate the list of documents based on the changes feed. On the admin port the _all_docs feed is still generated by iterating over all the documents in the underlying bucket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants