From 9d5f8e137fb7a83b89f9db15f0dbf05633f7459c Mon Sep 17 00:00:00 2001 From: thisgun Date: Thu, 31 Jul 2025 17:12:43 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B4=80=EB=A6=AC=EC=9E=90=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=EC=9D=B8=EC=8B=9C=20=EC=83=88=EA=B8=80=20=ED=85=8C?= =?UTF-8?q?=EC=9D=B4=EB=B8=94=20OPIMIZE=20=EC=8B=A4=ED=96=89=EC=8B=9C=20?= =?UTF-8?q?=EB=94=9C=EB=A0=88=EC=9D=B4=20=EB=90=98=EB=8A=94=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=EA=B0=9C=EC=84=A02?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/db_table.optimize.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bbs/db_table.optimize.php b/bbs/db_table.optimize.php index a751c50ba..6ec1875dd 100644 --- a/bbs/db_table.optimize.php +++ b/bbs/db_table.optimize.php @@ -14,7 +14,9 @@ if($config['cf_visit_del'] > 0) { $tmp_before_date = date("Y-m-d", G5_SERVER_TIME - ($config['cf_visit_del'] * 86400)); $sql = " delete from {$g5['visit_table']} where vi_date < '$tmp_before_date' "; sql_query($sql); - sql_query(" OPTIMIZE TABLE `{$g5['visit_table']}`, `{$g5['visit_sum_table']}` "); + if (defined('G5_USE_OPTIMIZE_DBTABLE') && G5_USE_OPTIMIZE_DBTABLE) { + sql_query(" OPTIMIZE TABLE `{$g5['visit_table']}`, `{$g5['visit_sum_table']}` "); + } } // 설정일이 지난 인기검색어 삭제 @@ -22,7 +24,9 @@ if($config['cf_popular_del'] > 0) { $tmp_before_date = date("Y-m-d", G5_SERVER_TIME - ($config['cf_popular_del'] * 86400)); $sql = " delete from {$g5['popular_table']} where pp_date < '$tmp_before_date' "; sql_query($sql); - sql_query(" OPTIMIZE TABLE `{$g5['popular_table']}` "); + if (defined('G5_USE_OPTIMIZE_DBTABLE') && G5_USE_OPTIMIZE_DBTABLE) { + sql_query(" OPTIMIZE TABLE `{$g5['popular_table']}` "); + } } // 설정일이 지난 최근게시물 삭제 @@ -40,7 +44,9 @@ if($config['cf_new_del'] > 0) { if($config['cf_memo_del'] > 0) { $sql = " delete from {$g5['memo_table']} where (TO_DAYS('".G5_TIME_YMDHIS."') - TO_DAYS(me_send_datetime)) > '{$config['cf_memo_del']}' "; sql_query($sql); - sql_query(" OPTIMIZE TABLE `{$g5['memo_table']}` "); + if (defined('G5_USE_OPTIMIZE_DBTABLE') && G5_USE_OPTIMIZE_DBTABLE) { + sql_query(" OPTIMIZE TABLE `{$g5['memo_table']}` "); + } } // 탈퇴회원 자동 삭제