omnifaces / omnipersistence

Utilities for JPA, JDBC and DataSources
Other
31 stars 12 forks source link

remove sorting for count queries #1

Closed Dennis-Brouwer closed 8 years ago

Dennis-Brouwer commented 8 years ago

The count query that is executed after the retrieval of entities still uses order by. For rather large result sets the database may need a lot of memory to apply the sorting or even may generate huge temporary files. Generating temporary files is a performance killer on cloud hardware. Since sorting is not required for count queries and performance improvements are always nice removal of order by is the only resolution to fix this.