From 8656fd028a20c52130f061bc8292c03e3ae514c0 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Wed, 11 Apr 2018 13:10:55 -0700 Subject: [PATCH] add coalesce bug_status_cache index to schema from installsql --- sql/debbugs_schema.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sql/debbugs_schema.sql b/sql/debbugs_schema.sql index c091a6e..0b5b86e 100644 --- a/sql/debbugs_schema.sql +++ b/sql/debbugs_schema.sql @@ -443,7 +443,10 @@ CREATE TABLE bug_status_cache ( modified TIMESTAMP WITH TIME ZONE DEFAULT NOW() NOT NULL, asof TIMESTAMP WITH TIME ZONE DEFAULT NOW() NOT NULL ); -CREATE UNIQUE INDEX bug_status_cache_bug_suite_arch_idx ON bug_status_cache(bug,suite,arch); +CREATE UNIQUE INDEX bug_status_cache_bug_suite_arch_idx ON + bug_status_cache(bug,suite,arch); +CREATE UNIQUE INDEX bug_status_cache_bug_col_suite_col_arch_idx ON + bug_status_cache(bug,COALESCE(suite,0),COALESCE(arch,0)); CREATE INDEX bug_status_cache_idx_bug ON bug_status_cache(bug); CREATE INDEX bug_status_cache_idx_status ON bug_status_cache(status); CREATE INDEX bug_status_cache_idx_arch ON bug_status_cache(arch); -- 2.39.2