Task #53514

Epic #55070: Workpackages

Epic #55065: WP: Overall System Performance (Backend and Frontend)

Epic #55656: Optimize overall Extbase performance

Story #55168: Optimize Extbase generic persistence

Extbase: DataMapper causes redundant queries

Added by Nico de Haen almost 6 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Extbase
Target version:
Start date:
2013-11-11
Due date:
% Done:

100%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
medium
Sprint Focus:

Description

The thawProperties method of the DataMapper does not check the identity map before retrieving the property value with fetchRelated. This results in redundant queries on the same table with the same addWhere. For example SELECT tx_foo_domain_model_bar.* FROM tx_foo_domain_model_bar WHERE uid IN ('1')

ztest.zip (660 KB) Nico de Haen, 2014-01-18 00:04


Related issues

Related to TYPO3 Core - Task #55167: Extbase: avoid parseQuery() / buildQuery() to be called multiple times Closed 2014-03-20 2014-03-20
Related to TYPO3 Core - Bug #56442: Invalid FileReference used Closed 2014-02-28

Associated revisions

Revision faa6e8a6 (diff)
Added by Nico de Haen over 5 years ago

[BUGFIX] Check identity map for existing objects

The DataMapper should check if an object is already in the identityMap
before calling fetchRelated, since otherwise the object will be retrieved
from the database again.

Resolves: #53514
Releases: 6.1,6.2
Change-Id: I24e262322f1f0ba3c346fa01c50fa9063866aef7
Reviewed-on: https://review.typo3.org/25252
Reviewed-by: Nico de Haen
Reviewed-by: Fabien Udriot
Tested-by: Wouter Wolters
Reviewed-by: Steffen Müller
Tested-by: Steffen Müller

History

#1 Updated by Gerrit Code Review almost 6 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 https://review.typo3.org/25252

#2 Updated by Gerrit Code Review almost 6 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25252

#3 Updated by Gerrit Code Review almost 6 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25252

#4 Updated by Gerrit Code Review almost 6 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25252

#5 Updated by Gerrit Code Review almost 6 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25252

#6 Updated by Gerrit Code Review almost 6 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25252

#7 Updated by Gerrit Code Review almost 6 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25252

#8 Updated by Gerrit Code Review over 5 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25252

#9 Updated by Nico de Haen over 5 years ago

Here is a small demo extension to test the gerrit patch.

Father has a n:1 relation to child1. If there are 2 (or more) fathers with a relation to child with uid 1 it will result in 2 (or more) identical queries

SELECT tx_ztest_domain_model_child1.* FROM tx_ztest_domain_model_child1 WHERE tx_ztest_domain_model_child1.uid IN ('1') 

If there are 2 (or more) fathers with a relation to child with uid 1 it will result in a 2 (or more) identical queries
SELECT tx_ztest_domain_model_child1.* FROM tx_ztest_domain_model_child1 WHERE tx_ztest_domain_model_child1.uid IN ('0') 

#10 Updated by Gerrit Code Review over 5 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25252

#11 Updated by Felix Oertel over 5 years ago

  • Parent task set to #55168

#12 Updated by Felix Oertel over 5 years ago

  • Assignee set to Nico de Haen

#13 Updated by Gerrit Code Review over 5 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25252

#14 Updated by Ernesto Baschny over 5 years ago

  • Project changed from Extbase MVC Framework to TYPO3 Core
  • Category deleted (Extbase: Generic Persistence)

#15 Updated by Ernesto Baschny over 5 years ago

  • Category set to Extbase
  • TYPO3 Version set to 6.2

#16 Updated by Ernesto Baschny over 5 years ago

  • Subject changed from DataMapper causes redundant queries to Extbase: DataMapper causes redundant queries

#17 Updated by Nico de Haen over 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#18 Updated by Riccardo De Contardi almost 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF