Proposal : REINDEX SCHEMA

From: Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Proposal : REINDEX SCHEMA
Date: 2014-10-12 13:58:24
Message-ID: CAD21AoCiWv1YsF6de9bUE0MDCmfOtkW-w=qpSWM6Ea-7nuaiOQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

Attached WIP patch adds new syntax REINEX SCHEMA which does reindexing
all table of specified schema.
There are syntax dose reindexing specified index, per table and per database,
but we can not do reindexing per schema for now.
So we must use reindexdb command if we want to do.
This new syntax supports it as SQL command.
This use similar logic as REINDEX DATABASE, but we can use it in
transaction block.
Here is some example,

-- Table information
[postgres][5432](1)=# \d n1.hoge
Table "n1.hoge"
Column | Type | Modifiers
--------+---------+-----------
col | integer | not null
Indexes:
"hoge_pkey" PRIMARY KEY, btree (col)

[postgres][5432](1)=# \d n2.hoge
Table "n2.hoge"
Column | Type | Modifiers
--------+---------+-----------
col | integer |

[postgres][5432](1)=# \d n3.hoge
Did not find any relation named "n3.hoge".

-- Do reindexing
[postgres][5432](1)=# reindex schema n1;
NOTICE: table "n1.hoge" was reindexed
REINDEX
[postgres][5432](1)=# reindex schema n2;
REINDEX
[postgres][5432](1)=# reindex schema n3;
NOTICE: schema"n3" does not hava any table
REINDEX

Please review and comment.

Regards,

-------
Sawada Masahiko

Attachment Content-Type Size
reindex_schema_v1.patch application/octet-stream 4.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2014-10-12 15:44:46 Re: Proposal : REINDEX SCHEMA
Previous Message Matthew Woodcraft 2014-10-12 12:47:31 Re: UPSERT wiki page, and SQL MERGE syntax