From 312a5b246be8da36227c51682cd99cdf4d80ac07 Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Wed, 24 Nov 2021 16:55:34 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B04399=20Fix=20memory=20error=20on=20setup?= =?UTF-8?q?=20when=20lots=20of=20attachment=20in=20DB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- datamodels/2.x/itop-attachments/module.itop-attachments.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/datamodels/2.x/itop-attachments/module.itop-attachments.php b/datamodels/2.x/itop-attachments/module.itop-attachments.php index 838b57291..068b3c91e 100644 --- a/datamodels/2.x/itop-attachments/module.itop-attachments.php +++ b/datamodels/2.x/itop-attachments/module.itop-attachments.php @@ -177,6 +177,12 @@ SQL; SetupPage::log_info("Initializing attachment/item_org_id - zero to the container"); $oSearch = DBObjectSearch::FromOQL("SELECT Attachment WHERE item_org_id = 0"); $oSet = new DBObjectSet($oSearch); + $oSet->OptimizeColumnLoad([ + 'Attachment' => [ + 'item_class', + 'item_id', + ] + ]); $iUpdated = 0; while ($oAttachment = $oSet->Fetch()) {