From: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
---|---|
To: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
Cc: | Andres Freund <andres(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Simon Riggs <simon(at)2ndquadrant(dot)com> |
Subject: | Re: Support for REINDEX CONCURRENTLY |
Date: | 2013-03-10 04:46:27 |
Message-ID: | CAB7nPqQhki_jKg1LXiBnK3n7DGMSkaJYra1U_5OS6F6UnCK4Dg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Sun, Mar 10, 2013 at 4:50 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> On Sun, Mar 10, 2013 at 3:48 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
> wrote:
> > Thanks for updating the patch!
>
> - "SELECT
> reltoastidxid "
> - "FROM info_rels
> i JOIN pg_catalog.pg_class c "
> - " ON
> i.reloid = c.oid"));
> + "SELECT
> indexrelid "
> + "FROM info_rels
> i "
> + " JOIN
> pg_catalog.pg_class c "
> + " ON i.reloid
> = c.oid "
> + " JOIN
> pg_catalog.pg_index p "
> + " ON i.reloid
> = p.indrelid "
> + "WHERE
> p.indexrelid >= %u ", FirstNormalObjectId));
>
> This new SQL doesn't seem to be right. Old one doesn't pick up any indexes
> other than toast index, but new one seems to do.
>
Indeed, it was selecting all indexes...
I replaced it by this query reducing the selection of indexes for toast
relations:
- "SELECT
reltoastidxid "
- "FROM info_rels i
JOIN pg_catalog.pg_class c "
- " ON
i.reloid = c.oid"));
+ "SELECT
indexrelid "
+ "FROM pg_index "
+ "WHERE indrelid
IN (SELECT reltoastrelid "
+ " FROM
pg_class "
+ " WHERE
oid >= %u "
+ " AND
reltoastrelid != %u)",
+
FirstNormalObjectId, InvalidOid));
Will send patch soon...
--
Michael
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2013-03-10 05:18:43 | Re: Support for REINDEX CONCURRENTLY |
Previous Message | Jonathan Rogers | 2013-03-10 04:39:24 | Re: Btrfs clone WIP patch |