DDC-2378: Efficient count using Selectable #3087

Closed
doctrinebot opened this Issue Mar 28, 2013 · 3 comments

2 participants

@doctrinebot

Jira issue originally created by user bakura:

Hi,

I'm currently using intensively the Criteria and Selectable interfaces to provide a generic REST library.

However, I've found a problem when I want to paginate data:

return count($this->selectable->matching(new Criteria()));

The problem is that EntityRepository returns an ArrayCollection and, hence, load the whole collection which is inefficient. It would be nice if it could return a PersistentCollection instead with lazy-load and perform an optimized count.

Thanks

@doctrinebot

Comment created by stof:

duplicate of DDC-2217

@doctrinebot

Issue was closed with resolution "Duplicate"

@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-882] was closed:
#882

@Ocramius Ocramius was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment