View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003402 | OXID eShop (all versions) | 4.05. Performance | public | 2011-11-29 14:59 | 2012-12-10 13:29 |
Reporter | csimon | Assigned To | |||
Priority | high | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 4.5.4 revision 39463 | ||||
Fixed in Version | 4.6.0_beta3 | ||||
Summary | 0003402: Wrong join in oxarticlelist->loadCrossSell | ||||
Description | In loadCrossSell the shop uses the following query: $sSelect = "select $sArticleTable.* from oxobject2article left join $sArticleTable on oxobject2article.oxobjectid=$sArticleTable.oxid "; $sSelect .= "where oxobject2article.oxarticlenid = $sArticleId "; $sSelect .= " and $sArticleTable.oxid is not null and " .$oBaseObject->getSqlActiveSnippet(). " order by rand()"; The left join is unefficient, because it takes "null" results from the left table (which are the majority of results in this situation) and filters them in the where clause with "oxarticle is not null". An "inner join" would be much more efficient, because it filters the null results right when connecting the two tables. In fact, a left join is a inner join which does additional work by getting the null results, therefore, there is no reason to use a left join here. Same with the query for bidirectional crossselling. | ||||
Tags | Performance | ||||
Theme | Both | ||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||