Proposal : REINDEX SCHEMA - Mailing list pgsql-hackers

From Sawada Masahiko
Subject Proposal : REINDEX SCHEMA
Date
Msg-id CAD21AoCiWv1YsF6de9bUE0MDCmfOtkW-w=qpSWM6Ea-7nuaiOQ@mail.gmail.com
Whole thread Raw
Responses Re: Proposal : REINDEX SCHEMA
List 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

pgsql-hackers by date:

Previous
From: Matthew Woodcraft
Date:
Subject: Re: UPSERT wiki page, and SQL MERGE syntax
Next
From: Ronan Dunklau
Date:
Subject: Re: Hide 'Execution time' in EXPLAIN (COSTS OFF)