New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TASK] Media browser performance improvements #230
[TASK] Media browser performance improvements #230
Conversation
👍 |
Example of optimized query
vs.
|
} else { | ||
$queryString = 'SELECT count(a.persistence_object_identifier) c FROM typo3_media_domain_model_asset a LEFT JOIN typo3_media_domain_model_asset_tags_join tagmm ON a.persistence_object_identifier = tagmm.media_asset LEFT JOIN typo3_media_domain_model_assetcollection_assets_join collectionmm ON a.persistence_object_identifier = collectionmm.media_asset WHERE tagmm.media_tag = ? AND collectionmm.media_assetcollection = ?'; | ||
$queryString = 'SELECT count(a.persistence_object_identifier) c FROM typo3_media_domain_model_asset a LEFT JOIN typo3_media_domain_model_asset_tags_join tagmm ON a.persistence_object_identifier = tagmm.media_asset LEFT JOIN typo3_media_domain_model_assetcollection_assets_join collectionmm ON a.persistence_object_identifier = collectionmm.media_asset WHERE tagmm.media_tag = ? AND collectionmm.media_assetcollection = ? AND a.dtype != "typo3_media_imagevariant"'; | ||
} | ||
|
||
$query = $this->entityManager->createNativeQuery($queryString, $rsm); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this query work with all supported DBs?
left some comments, the rest is fine I guess. |
@kitsunet good catch, checked the query on postgres and it fails.. will push follow up |
Including image variants in asset searches returns lots of images that aren't desired since they're simple cropped versions of others.
Related: NEOS-1698
Optimizes the asset repository count queries to remove unnecessary joins resulting in ~10x performance gain. Related: NEOS-1698
Related: NEOS-1698
Resolves: NEOS-1698
Related: NEOS-1698
6f8916e
to
af56539
Compare
fixed the queries for postgres 👍 |
btw. since there's no functional changes, simply verify that the counts still work and the modal windows (delete asset, delete tag, delete collection) appear and work.. |
for reference, this changed the response time from 35 s to 5 s with 6000 assets and ~350 tags |
Good stuff, thanks a lot 👍 |
…vements TASK: Media browser performance improvements Optimizes rendering performance of the media browser/module by re-using modals, optimizing and using count queries. Brings 0,5x-3x+ speed improvement depending on the selected view and amount of assets and tags/asset collections visible. No functional difference. Additionally fixes a couple of bugs in the asset repository. NEOS-1698 #close
thanks |
i saw this has already been merged, but i still tried to "manually merge" this changes into my 2.0.4 test system (since i got around a thousand assets there to test the behaviour and performance) but unluckily for me these changes seem to depend on other changes not merged into my 2.0.4 instance yet, since i get: |
Optimizes rendering performance of the media browser/module by
re-using modals, optimizing and using count queries.
Brings 0,5x-3x+ speed improvement depending on the selected view
and amount of assets and tags/asset collections visible.
No functional difference.
Additionally fixes a couple of bugs in the asset repository.
Resolves: NEOS-1698