Re: Disabling an index temporarily - Mailing list pgsql-hackers

From Corey Huinker
Subject Re: Disabling an index temporarily
Date
Msg-id CADkLM=dyM93Kfigrp=fcCFz8HuTVLzyOLUEPvRLeTasUT2dpZQ@mail.gmail.com
Whole thread Raw
In response to Re: Disabling an index temporarily  (Bill Moran <wmoran@potentialtech.com>)
List pgsql-hackers
On Sun, Dec 13, 2015 at 10:23 PM, Bill Moran <wmoran@potentialtech.com> wrote:
On Sun, 13 Dec 2015 22:15:31 -0500
Corey Huinker <corey.huinker@gmail.com> wrote:

> ALTER TABLE foo DISABLE [NONUNIQUE] INDEXES
> -- same, but joining to pg_class and possibly filtering on indisunique

I would think that NONUNIQUE should be the default, and you should have
to specify something special to also disable unique indexes. Arguably,
unique indexes are actually an implementation detail of unique
constraints. Disabling a performance-based index doesn't cause data
corruption, whereas disabling an index created as part of unique
constraint can allow invalid data into the table.

Just my $.02 ...

--
Bill Moran

I'd be fine swapping NONUNIQUE for ALL and defaulting to non-unique, or flatly enforcing a rule that it won't disable the index required by an enabled constraint.


pgsql-hackers by date:

Previous
From: Corey Huinker
Date:
Subject: Re: Disabling an index temporarily
Next
From: Konstantin Knizhnik
Date:
Subject: Re: Logical replication and multimaster