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

Performance issues with CouchDbRepositorySupport.getAll() #249

Open
max-vogler opened this issue Jun 24, 2016 · 0 comments
Open

Performance issues with CouchDbRepositorySupport.getAll() #249

max-vogler opened this issue Jun 24, 2016 · 0 comments
Labels

Comments

@max-vogler
Copy link

I'm using Ektorp with an out-of-the-box Cloudant database (in case you don't know what Cloudant is, it is an extension of CouchDB).

I get terrible performance when calling CouchDbRepositorySupport.getAll() to retrieve all documents from a collection (15s for 60 documents). Debugging showed, that designDocContainsAllView() returns false and Ektorp uses a single query for every document.

    public List<T> getAll() {
        if (designDocContainsAllView()) { // <-- false!
            return queryView("all");
        }
        return loadAllByAllDocIds();
    }

Without any problem, I can replace the getAll() call with

repo.getDb().queryView(new ViewQuery().allDocs().includeDocs(true), MyPojo.class);

So there is a working view (_all_docs) to query all documents, why isn't it used instead of the horribly slow loadAllByAllDocIds()? And what is the difference between the all view and _all_docs view?

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

No branches or pull requests

2 participants