From f4ddbd3084b65a3ed79e0b9ba07baac1102fb6f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Fri, 25 Jun 2021 11:15:12 +0200 Subject: [PATCH] Added DB-Index for lehre.tbl_pruefung to speed up queries --- system/dbupdate_3.3.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index e658d7a97..407a4aa24 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4767,6 +4767,20 @@ if($result = @$db->db_query("SELECT 1 FROM system.tbl_berechtigung WHERE berecht } } +// Add index to system.tbl_log +if ($result = $db->db_query("SELECT * FROM pg_class WHERE relname='idx_tbl_pruefung_student_uid'")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = "CREATE INDEX idx_tbl_pruefung_student_uid ON lehre.tbl_pruefung USING btree (student_uid)"; + + if (! $db->db_query($qry)) + echo 'Indizes: ' . $db->db_last_error() . '
'; + else + echo 'Index fuer lehre.pruefung.student_uid hinzugefuegt
'; + } +} + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

';