View Issue Details

IDProjectCategoryView StatusLast Update
0007628OXID eShop (all versions)4.01. Database handlingpublic2024-09-11 15:05
ReporterAdrianFrey Assigned To 
PrioritynormalSeveritytweakReproducibilityalways
Status confirmedResolutionopen 
Summary0007628: Unnecessary performance issue with queries for getOne
DescriptionThere are still queries for 'public function getOne($query, $parameters = []);' which are not limited with LIMIT.

vendor/oxid-esales/oxideshop-ce/source/Application/Model/Article.php
vendor/oxid-esales/oxideshop-ce/source/Application/Model/Basket.php
vendor/oxid-esales/oxideshop-ce/source/Application/Model/Discount.php
vendor/oxid-esales/oxideshop-ce/source/Application/Model/DiscountList.php
vendor/oxid-esales/oxideshop-ce/source/Application/Model/Order.php
vendor/oxid-esales/oxideshop-ce/source/Application/Model/Search.php
vendor/oxid-esales/oxideshop-ce/source/Application/Model/User.php
vendor/oxid-esales/oxideshop-ce/source/Application/Model/Voucher.php
vendor/oxid-esales/oxideshop-ce/source/Core/SeoEncoder.php
vendor/oxid-esales/oxideshop-ce/source/Core/Utils.php
vendor/oxid-esales/oxideshop-ee/Core/Config.php
Additional Informationpublic function getOne($query, $parameters = []);

https://github.com/OXID-eSales/oxideshop_ce/blob/87a3c096832e7efc2c3cdd8ed699ed510efad83c/source/Core/Database/Adapter/DatabaseInterface.php#L117

The comment also tells, that you should use LIMIT
TagsNo tags attached.
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
Database VersionNot defined

Activities

QA

2024-04-10 09:26

administrator   ~0016741

I recognize the problem, but would also like to add that the many function calls I've seen don't cause much overhead, in part because they directly consider an OXID to be a unique value. Nevertheless, there are function calls that have a correspondingly large intermediate result for large amounts of data, which is then reduced to a single result with fetchColumn.
OXID 7.1 still uses fetchColumn, which is marked as depricated.

QA - SG -