From 128afc8a56a3fca3f75d778bbdca7b174ccee5f9 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 13 Sep 2019 10:40:28 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B02272=20-=20OQL=20performance=20(comments?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/sqlobjectquerybuilder.class.inc.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/core/sqlobjectquerybuilder.class.inc.php b/core/sqlobjectquerybuilder.class.inc.php index b36035e4f..b37e2fbc0 100644 --- a/core/sqlobjectquerybuilder.class.inc.php +++ b/core/sqlobjectquerybuilder.class.inc.php @@ -183,9 +183,6 @@ class SQLObjectQueryBuilder // -> ext keys required for a friendly name // $aExtKeys = array(); // array of sTableClass => array of (sAttCode (keys) => array of (sAttCode (fields)=> oAttDef)) - // - // Optimization: could be partially computed once for all (cached) ? - // // Get all Ext keys used by the filter foreach ($this->oDBObjetSearch->GetCriteria_PointingTo() as $sKeyAttCode => $aPointingTo) @@ -416,7 +413,7 @@ class SQLObjectQueryBuilder } } - // Additional JOINS for Friendly names + // Additional JOINS for polymorphic expressions (friendlyname, obsolescenceflag...) // foreach ($aFNJoinAlias as $sSubClass => $sSubClassAlias) { @@ -464,15 +461,12 @@ class SQLObjectQueryBuilder $bIsOnQueriedClass = array_key_exists($sTargetAlias, $oBuild->GetRootFilter()->GetSelectedClasses()); - //self::DbgTrace("Entering: tableclass=$sTableClass, filter=".$this->oDBObjetSearch->ToOQL().", ".($bIsOnQueriedClass ? "MAIN" : "SECONDARY")); - // 1 - SELECT and UPDATE // // Note: no need for any values nor fields for foreign Classes (ie not the queried Class) // $aUpdateValues = array(); - // 1/a - Get the key and friendly name // // We need one pkey to be the key, let's take the first one available @@ -486,7 +480,7 @@ class SQLObjectQueryBuilder $oSelectedIdField = $oIdField; } - // 1/b - Get the other attributes + // 1/b - Prepare Update attributes // foreach(MetaModel::ListAttributeDefs($sTableClass) as $sAttCode=>$oAttDef) { @@ -557,7 +551,7 @@ class SQLObjectQueryBuilder $aPointingTo = $this->oDBObjetSearch->GetCriteria_PointingTo($sKeyAttCode); if (!array_key_exists(TREE_OPERATOR_EQUALS, $aPointingTo)) { - // The join was not explicitely defined in the filter, + // The join was not explicitly defined in the filter, // we need to do it now $sKeyClass = $oKeyAttDef->GetTargetClass(); $sKeyClassAlias = $oBuild->GenerateClassAlias($sKeyClass.'_'.$sKeyAttCode, $sKeyClass);