View Issue Details

IDProjectCategoryView StatusLast Update
0003918OXID eShop (all versions)4.05. Performancepublic2012-12-10 13:29
Reporterb.hasis Assigned To 
PriorityimmediateSeverityblockReproducibilityalways
Status resolvedResolutionfixed 
Product Version4.5.10 revision 44222 
Fixed in Version4.6.1 revision 45706 
Summary0003918: new query in oxattributelist::loadAttributes() isnt performant
DescriptionThe Query to select the Attributes of an parentarticle is not performant.
If you call oxattributelist::loadAttributes() by an Variant the generated query are running for a very long time(in a small shop). In a bigger one (Over 20000 articel) it crashed.
Steps To ReproduceCreate an Articel and also a variants.
Open this in Frontend and analyse the query wich is generated in oxattributelist::loadAttributes().
Additional Informationtested with mySql: 5.1.30 and 5.1.58-log
TagsPerformance
Attached Files
oxattributelist.php (7,801 bytes)
oxlist.php (12,890 bytes)
oxidbug.jpg (283,041 bytes)   
oxidbug.jpg (283,041 bytes)   
OxidBug3918.zip (264,812 bytes)
ThemeBoth
BrowserAll
PHP Version5.2.9
Database Versionany

Activities

Linas Kukulskis

2012-04-25 13:46

reporter   ~0006447

changed complicated query to 2 more simple (old way solution)

Linas Kukulskis

2012-04-25 14:45

reporter   ~0006448

attached fix in files oxattributelist.php and oxlist.php.
in oxlist.php: added setArray() method, in oxattributelist.php added _mergeAttributes() methods and changed loadAttributes() method.

Linas Kukulskis

2012-04-25 15:43

reporter   ~0006450

Reminder sent to: b.hasis

Hi, can you provide any logs data or error message or something else that can help as to debug more this case?

Linas Kukulskis

2012-04-25 15:43

reporter   ~0006451

reopen

b.hasis

2012-04-25 16:32

reporter   ~0006453

Hi,

i dont got any logs. Just a heidiSql Profiling of the query. (oxidbug.jpg)

b.hasis

2012-04-25 16:34

reporter   ~0006454

Last edited: 2012-04-25 16:41

Just add some DB-Files( OxidBug3918.zip) to Reproduce the query shown in my pic.

Here the Query thats generated in oxattributelist.php

SELECT `Attributes`.`oxid`, `Attributes`.`oxtitle`, IFNULL( `ArticleAtrr`.`oxvalue`, `ParentAtrr`.`oxvalue` ) AS `oxvalue`
FROM oxv_oxattribute_1_de AS `Attributes`
LEFT JOIN oxv_oxobject2attribute_de AS `ArticleAtrr` ON `Attributes`.`oxid` = `ArticleAtrr`.`oxattrid`
LEFT JOIN oxv_oxobject2attribute_de AS `ParentAtrr` ON `Attributes`.`oxId` = `ParentAtrr`.`oxattrid`
WHERE 1 AND `ArticleAtrr`.`oxobjectid` = '0f78aa3d7ddf8d3b12fc9ad8016bd282' AND `ArticleAtrr`.`oxvalue` != '' OR `ParentAtrr`.`oxobjectid` = 'b56369b1fc9d7b97f9c5fc343b349ece'
AND `ParentAtrr`.`oxvalue` != ''
ORDER BY `ArticleAtrr`.`oxpos`, `ParentAtrr`.`oxpos`, `Attributes`.`oxpos`

dainius.bigelis

2012-05-07 15:53

reporter   ~0006525

The issue is fixed in eShop 4.5.11 version, as described in the second comment:
"attached fix in files oxattributelist.php and oxlist.php.
in oxlist.php: added setArray() method, in oxattributelist.php added _mergeAttributes() methods and changed loadAttributes() method."