Bug #67837
closedExtbase performs unnecessary count queries
100%
Description
Quoting from https://jira.neos.io/browse/FLOW-326:
QueryResult::count()
always execute a COUNT query, even if the results have been fetched or counted already.
This is especially an issue because we make use of this method a lot under the hood.
For example this (simplified but realistic) Fluid snippet:
<f:if condition="{products}"> <h1>{products -> f:count()} products:</h1> <f:widget.paginate objects="{products}" as="paginatedProducts"> <ul> <f:for each="{paginatedProducts}" as="product" iteration="iteration"> <li>{product.name}</li> </f:for> </ul> </f:widget.paginate> </f:if>
will execute the same SELECT COUNT(DISTINCT ...
query four times.
And those counts can be very costly especially with complex queries or many rows in a INNODB table.
Updated by Gerrit Code Review over 9 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40750
Updated by Gerrit Code Review over 9 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40750
Updated by Gerrit Code Review over 9 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40750
Updated by Gerrit Code Review over 9 years ago
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40778
Updated by Mathias Brodala over 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 50 to 100
Applied in changeset 4cd7c50463a80bccfac190906fc4d2c3e0364386.