From e83bf94b5ba1d30cd8e2158bf59bffedc0565102 Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Wed, 22 Oct 2008 18:32:31 +0000
Subject: [PATCH] - Patch #324110 by killes: added an index on uid to make
 deleting watchdog entries faster.

---
 modules/dblog/dblog.install | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/modules/dblog/dblog.install b/modules/dblog/dblog.install
index ca9107c8fda0..e7310275d0a1 100644
--- a/modules/dblog/dblog.install
+++ b/modules/dblog/dblog.install
@@ -98,6 +98,7 @@ function dblog_schema() {
     'primary key' => array('wid'),
     'indexes' => array(
       'type' => array('type'),
+      'uid' => array('uid'),
     ),
   );
 
@@ -113,3 +114,12 @@ function dblog_update_7001() {
   db_change_field($ret, 'watchdog', 'referer', 'referer', array('type' => 'varchar', 'length' => 255, 'not null' => FALSE, 'default' => ''));
   return $ret;
 }
+
+/**
+ * Add index on uid.
+ */
+function dblog_update_7002() {
+  $ret = array();
+  db_add_index($ret, 'watchdog', 'uid', array('uid'));
+  return $ret;
+}
-- 
GitLab