Skip to content


DDC-2378: Efficient count using Selectable #3087

doctrinebot opened this Issue · 3 comments

2 participants


Jira issue originally created by user bakura:


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.



Comment created by stof:

duplicate of DDC-2217


Issue was closed with resolution "Duplicate"


Comment created by @doctrinebot:

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

@Ocramius Ocramius was assigned by doctrinebot
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.