From 9b8dace833ff476b1d2b17ca1b062488c0380213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guy=20Couronn=C3=A9?= Date: Fri, 15 Mar 2019 11:17:58 +0100 Subject: [PATCH] :zap: Optimize Column load when using api core/get Getting in SQL only desired columns to show Used when output_fields != '*' || '*+' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Guy Couronné --- core/restservices.class.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/restservices.class.inc.php b/core/restservices.class.inc.php index c052799c5..5288714d2 100644 --- a/core/restservices.class.inc.php +++ b/core/restservices.class.inc.php @@ -467,6 +467,12 @@ class CoreServices implements iRestServiceProvider } else { + if (!$bExtendedOutput && RestUtils::GetOptionalParam($aParams, 'output_fields', '*') != '*') + { + $aAttToLoad = array($oObjectSet->GetClassAlias() => $aShowFields[$sClass]); + $oObjectSet->OptimizeColumnLoad($aAttToLoad); + } + while ($oObject = $oObjectSet->Fetch()) { $oResult->AddObject(0, '', $oObject, $aShowFields, $bExtendedOutput);