From 770df68eb22f18a8a4a2171c8c3bfea25704584f Mon Sep 17 00:00:00 2001 From: Carlos Proensa Date: Fri, 25 Sep 2015 22:37:15 +0200 Subject: [PATCH] Improve sql performance print_project_option_list Cache subprojects before processing them to reduce the number of SQL queries executed. Previously, only first level projects got cached, resulting in repeated queries (one for each project). Fixes #20139 Signed-off-by: Damien Regad --- core/print_api.php | 1 + 1 file changed, 1 insertion(+) diff --git a/core/print_api.php b/core/print_api.php index 9ce5bf901b..97da53e9c3 100644 --- a/core/print_api.php +++ b/core/print_api.php @@ -617,6 +617,7 @@ function print_subproject_option_list( $p_parent_id, $p_project_id = null, $p_fi array_push( $p_parents, $p_parent_id ); $t_user_id = auth_get_current_user_id(); $t_project_ids = user_get_accessible_subprojects( $t_user_id, $p_parent_id ); + project_cache_array_rows( $t_project_ids ); $t_can_report = true; foreach( $t_project_ids as $t_id ) {