Permalink
Browse files

- Added index on cache.created + small fixes in mssql DDL script

  • Loading branch information...
1 parent ae9124d commit e4d9f05e4126501ce329fc4c36704375f6dfe681 @alecpl alecpl committed Nov 24, 2008
View
@@ -128,6 +128,9 @@ GO
CREATE INDEX [IX_cache_cache_key] ON [dbo].[cache]([cache_key]) ON [PRIMARY]
GO
+ CREATE INDEX [IX_cache_created] ON [dbo].[cache]([created]) ON [PRIMARY]
+GO
+
ALTER TABLE [dbo].[contacts] ADD
CONSTRAINT [DF_contacts_user_id] DEFAULT (0) FOR [user_id],
CONSTRAINT [DF_contacts_changed] DEFAULT (getdate()) FOR [changed],
@@ -179,10 +182,10 @@ GO
CREATE INDEX [IX_messages_cache_key] ON [dbo].[messages]([cache_key]) ON [PRIMARY]
GO
- CREATE INDEX [IX_messages_idx] ON [dbo].[messages]([idx]) ON [PRIMARY]
+ CREATE INDEX [IX_messages_uid] ON [dbo].[messages]([uid]) ON [PRIMARY]
GO
- CREATE INDEX [IX_messages_uid] ON [dbo].[messages]([uid]) ON [PRIMARY]
+ CREATE INDEX [IX_messages_created] ON [dbo].[messages]([created]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[session] ADD
@@ -202,3 +205,9 @@ ALTER TABLE [dbo].[users] ADD
CONSTRAINT [DF_users_language] DEFAULT ('en') FOR [language]
GO
+ CREATE INDEX [IX_users_username] ON [dbo].[users]([username]) ON [PRIMARY]
+GO
+
+ CREATE INDEX [IX_users_alias] ON [dbo].[users]([alias]) ON [PRIMARY]
+GO
+
View
@@ -15,6 +15,7 @@ CREATE TABLE `cache` (
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`data` longtext NOT NULL,
PRIMARY KEY (`cache_id`),
+ INDEX `created_index` (`created`),
INDEX `user_cache_index` (`user_id`,`cache_key`)
);
View
@@ -38,3 +38,6 @@ ALTER TABLE `cache`
ALTER TABLE `session`
ADD INDEX `changed_index` (`changed`);
+
+ALTER TABLE `cache`
+ ADD INDEX `created_index` (`created`);
View
@@ -73,6 +73,7 @@ CREATE TABLE `cache` (
`data` longtext NOT NULL,
`user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY(`cache_id`),
+ INDEX `created_index` (`created`),
INDEX `user_cache_index` (`user_id`,`cache_key`),
CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`)
View
@@ -135,6 +135,7 @@ CREATE TABLE "cache" (
);
CREATE INDEX cache_user_id_idx ON "cache" (user_id, cache_key);
+CREATE INDEX cache_created_idx ON "cache" (created);
--
-- Sequence "message_ids"
View
@@ -27,3 +27,4 @@ CREATE INDEX messages_created_idx ON messages (created);
ALTER TABLE cache DROP session_id;
CREATE INDEX session_changed_idx ON session (changed);
+CREATE INDEX cache_created_idx ON "cache" (created);
View
@@ -17,6 +17,7 @@ CREATE TABLE cache (
);
CREATE INDEX ix_cache_user_cache_key ON cache(user_id, cache_key);
+CREATE INDEX ix_cache_created ON cache(created);
-- --------------------------------------------------------
View
@@ -33,3 +33,4 @@ CREATE INDEX ix_messages_created ON messages (created);
-- Updates from version 0.2-beta
CREATE INDEX ix_session_changed ON session (changed);
+CREATE INDEX ix_cache_created ON cache (created);

0 comments on commit e4d9f05

Please sign in to comment.