[CalendarServer-changes] [6729] CalendarServer/trunk/txdav/common/datastore/sql_schema_v1.sql

source_changes at macosforge.org source_changes at macosforge.org
Tue Jan 11 14:01:32 PST 2011


Revision: 6729
          http://trac.macosforge.org/projects/calendarserver/changeset/6729
Author:   glyph at apple.com
Date:     2011-01-11 14:01:16 -0800 (Tue, 11 Jan 2011)
Log Message:
-----------
indexed columns for all calendar and notification tables with 'on delete cascade'

Modified Paths:
--------------
    CalendarServer/trunk/txdav/common/datastore/sql_schema_v1.sql

Modified: CalendarServer/trunk/txdav/common/datastore/sql_schema_v1.sql
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/sql_schema_v1.sql	2011-01-11 21:53:13 UTC (rev 6728)
+++ CalendarServer/trunk/txdav/common/datastore/sql_schema_v1.sql	2011-01-11 22:01:16 UTC (rev 6729)
@@ -1,3 +1,21 @@
+-- -*- test-case-name: txdav.caldav.datastore.test.test_sql,txdav.carddav.datastore.test.test_sql -*-
+
+----
+-- Copyright (c) 2010 Apple Inc. All rights reserved.
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+----
+
 -----------------
 -- Resource ID --
 -----------------
@@ -14,6 +32,7 @@
   OWNER_UID        varchar(255) not null unique
 );
 
+create index CALENDAR_HOME_OWNER_UID on CALENDAR_HOME(OWNER_UID);
 
 ----------------------------
 -- Calendar Home Metadata --
@@ -24,6 +43,8 @@
   QUOTA_USED_BYTES integer      default 0 not null
 );
 
+create index CALENDAR_HOME_METADATA_RESOURCE_ID
+    on CALENDAR_HOME_METADATA(RESOURCE_ID);
 
 --------------
 -- Calendar --
@@ -48,6 +69,9 @@
     RESOURCE_ID        integer      not null
 );
 
+create index INVITE_INVITE_UID on INVITE(INVITE_UID);
+create index INVITE_RESOURCE_ID on INVITE(INVITE_UID);
+create index INVITE_HOME_RESOURCE_ID on INVITE(INVITE_UID);
 
 ---------------------------
 -- Sharing Notifications --
@@ -58,7 +82,9 @@
   OWNER_UID   varchar(255) not null unique
 );
 
+create index NOTIFICATION_HOME_OWNER_UID on NOTIFICATION_HOME(OWNER_UID);
 
+
 create table NOTIFICATION (
   RESOURCE_ID                   integer      primary key default nextval('RESOURCE_ID_SEQ'),
   NOTIFICATION_HOME_RESOURCE_ID integer      not null references NOTIFICATION_HOME,
@@ -72,7 +98,11 @@
   unique(NOTIFICATION_UID, NOTIFICATION_HOME_RESOURCE_ID)
 );
 
+create index NOTIFICATION_NOTIFICATION_HOME_RESOURCE_ID on
+  NOTIFICATION(NOTIFICATION_HOME_RESOURCE_ID);
 
+create index NOTIFICATION_NOTIFICATION_UID on NOTIFICATION(NOTIFICATION_UID);
+
 -------------------
 -- Calendar Bind --
 -------------------
@@ -97,6 +127,11 @@
   unique(CALENDAR_HOME_RESOURCE_ID, CALENDAR_RESOURCE_NAME)
 );
 
+create index CALENDAR_BIND_HOME_RESOURCE_ID on
+  CALENDAR_BIND(CALENDAR_HOME_RESOURCE_ID);
+create index CALENDAR_BIND_RESOURCE_ID on
+  CALENDAR_BIND(CALENDAR_RESOURCE_ID);
+
 -- Enumeration of calendar bind modes
 
 create table CALENDAR_BIND_MODE (
@@ -155,6 +190,12 @@
   -- unique(CALENDAR_RESOURCE_ID, ICALENDAR_UID)
 );
 
+create index CALENDAR_OBJECT_CALENDAR_RESOURCE_ID on
+  CALENDAR_OBJECT(CALENDAR_RESOURCE_ID);
+
+create index CALENDAR_OBJECT_ORGANIZER_OBJECT on
+  CALENDAR_OBJECT(ORGANIZER_OBJECT);
+
 -- Enumeration of attachment modes
 
 create table CALENDAR_OBJECT_ATTACHMENTS_MODE (
@@ -201,6 +242,12 @@
   TRANSPARENT                 boolean        not null
 );
 
+create index TIME_RANGE_CALENDAR_RESOURCE_ID on
+  TIME_RANGE(CALENDAR_RESOURCE_ID);
+create index TIME_RANGE_CALENDAR_OBJECT_RESOURCE_ID on
+  TIME_RANGE(CALENDAR_OBJECT_RESOURCE_ID);
+
+
 -- Enumeration of free/busy types
 
 create table FREE_BUSY_TYPE (
@@ -225,6 +272,8 @@
   TRANSPARENT                 boolean      not null
 );
 
+create index TRANSPARENCY_TIME_RANGE_INSTANCE_ID on
+  TRANSPARENCY(TIME_RANGE_INSTANCE_ID);
 
 ----------------
 -- Attachment --
@@ -242,7 +291,10 @@
   unique(CALENDAR_OBJECT_RESOURCE_ID, PATH)
 );
 
+create index ATTACHMENT_CALENDAR_OBJECT_RESOURCE_ID on
+  ATTACHMENT(CALENDAR_OBJECT_RESOURCE_ID);
 
+
 ------------------
 -- iTIP Message --
 ------------------
@@ -256,6 +308,10 @@
 );
 
 
+create index ITIP_MESSAGE_CALENDAR_RESOURCE_ID on
+  ITIP_MESSAGE(CALENDAR_RESOURCE_ID);
+
+
 -----------------------
 -- Resource Property --
 -----------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110111/0810b89f/attachment-0001.html>


More information about the calendarserver-changes mailing list