From: Don Armstrong Date: Wed, 11 Apr 2018 20:10:55 +0000 (-0700) Subject: add coalesce bug_status_cache index to schema from installsql X-Git-Url: https://git.donarmstrong.com/?p=debbugs.git;a=commitdiff_plain;h=8656fd028a20c52130f061bc8292c03e3ae514c0 add coalesce bug_status_cache index to schema from installsql --- 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);