From da2349bb6a85d13f0aa29046bef3021cf0c884ba Mon Sep 17 00:00:00 2001
From: friendica <info@friendica.com>
Date: Thu, 12 Feb 2015 17:45:25 -0800
Subject: provide relief to sites that are severely impacted by the slow
 ITEM_UNSEEN searches. This does not incorporate any other flag optimisations
 as that will require a major DB update and possibly involve significant
 downtime. This is just to bite off a little chunk now and provide some much
 needed relief.

---
 install/schema_postgres.sql | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'install/schema_postgres.sql')

diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql
index b68a7cb97..d852f38e9 100644
--- a/install/schema_postgres.sql
+++ b/install/schema_postgres.sql
@@ -528,6 +528,7 @@ CREATE TABLE "item" (
   "item_restrict" bigint NOT NULL DEFAULT '0',
   "item_flags" bigint NOT NULL DEFAULT '0',
   "item_private" numeric(4) NOT NULL DEFAULT '0',
+  "item_unseen" smallint(1) NOT NULL DEFAULT '0',
   "item_search_vector" tsvector,
   PRIMARY KEY ("id")
 );
@@ -559,6 +560,7 @@ create index "item_uid_mid" on item ("mid","uid");
 create index "item_public_policy" on item ("public_policy");
 create index "item_comment_policy" on item ("comment_policy");
 create index "item_layout_mid" on item ("layout_mid");
+create index "item_unseen" on item ("item_unseen");
 
 -- fulltext indexes
 create index "item_search_idx" on  item USING gist("item_search_vector");
-- 
cgit v1.2.3

