From: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
---|---|
To: | Andres Freund <andres(at)2ndquadrant(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Simon Riggs <simon(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Support for REINDEX CONCURRENTLY |
Date: | 2012-12-11 00:47:30 |
Message-ID: | CAB7nPqQaPCRZRQEGucsD3z6c7W2YBU4aeVH4p744+X=cQtaiOA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Dec 10, 2012 at 11:51 PM, Andres Freund <andres(at)2ndquadrant(dot)com>wrote:
> Btw, as an example of the problems caused by renaming:
>
> postgres=# CREATE TABLE a (id serial primary key); CREATE TABLE b(id
> serial primary key, a_id int REFERENCES a);
> CREATE TABLE
> Time: 137.840 ms
> CREATE TABLE
> Time: 143.500 ms
> postgres=# \d b
> Table "public.b"
> Column | Type | Modifiers
> --------+---------+------------------------------------------------
> id | integer | not null default nextval('b_id_seq'::regclass)
> a_id | integer |
> Indexes:
> "b_pkey" PRIMARY KEY, btree (id)
> Foreign-key constraints:
> "b_a_id_fkey" FOREIGN KEY (a_id) REFERENCES a(id)
>
> postgres=# REINDEX TABLE a CONCURRENTLY;
> NOTICE: drop cascades to constraint b_a_id_fkey on table b
> REINDEX
> Time: 248.992 ms
> postgres=# \d b
> Table "public.b"
> Column | Type | Modifiers
> --------+---------+------------------------------------------------
> id | integer | not null default nextval('b_id_seq'::regclass)
> a_id | integer |
> Indexes:
> "b_pkey" PRIMARY KEY, btree (id)
>
Oops. I will fix that in the next version of the patch. There should be an
elegant way to change the dependencies at the swap phase.
--
Michael Paquier
http://michael.otacoo.com
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2012-12-11 01:04:55 | Re: Commits 8de72b and 5457a1 (COPY FREEZE) |
Previous Message | Noah Misch | 2012-12-10 23:57:23 | Re: Commits 8de72b and 5457a1 (COPY FREEZE) |