From 082c17284c9d2495a86905de10c32b860fb0ad38 Mon Sep 17 00:00:00 2001
From: alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>
Date: Thu, 12 Jun 2008 17:46:31 +0000
Subject: #1485125: added index on messages.created

git-svn-id: https://svn.roundcube.net/trunk@1522 208e9e7b-5314-0410-a742-e7e81cd9613c
---
 roundcubemail/SQL/postgres.initial.sql | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'roundcubemail/SQL/postgres.initial.sql')

diff --git a/roundcubemail/SQL/postgres.initial.sql b/roundcubemail/SQL/postgres.initial.sql
index 05c61924a..88f12af66 100644
--- a/roundcubemail/SQL/postgres.initial.sql
+++ b/roundcubemail/SQL/postgres.initial.sql
@@ -152,7 +152,7 @@ CREATE SEQUENCE message_ids
 -- Name: messages; Type: TABLE; Schema: public; Owner: postgres
 --
 
-CREATE TABLE "messages" (
+CREATE TABLE messages (
     message_id integer DEFAULT nextval('message_ids'::text) PRIMARY KEY,
     user_id integer NOT NULL REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
     del integer DEFAULT 0 NOT NULL,
@@ -170,4 +170,5 @@ CREATE TABLE "messages" (
     structure text
 );
 
-ALTER TABLE "messages" ADD UNIQUE (user_id, cache_key, uid);
+ALTER TABLE messages ADD UNIQUE (user_id, cache_key, uid);
+CREATE INDEX messages_created_idx ON messages (created);
-- 
cgit v1.2.3

