Re: script to drop and create all indexes in a database with parameter concurrently - Mailing list pgsql-admin

From Doom.zhou
Subject Re: script to drop and create all indexes in a database with parameter concurrently
Date
Msg-id CAK=muZv5yG3t=Gr1sBNiXvXNyoboVvUW_n1b9Xfg4axniobS2g@mail.gmail.com
Whole thread Raw
In response to script to drop and create all indexes in a database with parameter concurrently  ("Campbell, Lance" <lance@illinois.edu>)
Responses Re: script to drop and create all indexes in a database with parameter concurrently  ("Doom.zhou" <zzepaigh@gmail.com>)
List pgsql-admin



On Wed, Dec 18, 2013 at 4:24 AM, Campbell, Lance <lance@illinois.edu> wrote:

Below is a Linux script I wrote that will drop and create all of the indexes for your database with the “concurrently” parameter.

 

#!/bin/sh

 

dbhost=localhost

database=somedatabasename

dbschema=/tempfile/dbschema.txt

filtered=/tempfile/dbschema_filtered.txt

sql=/tempfile/rebuild_indexes.sql

 

rm "$dbschema"

rm "$filtered"

rm "$sql"

 

pg_dump -s -h "$dbhost" "$database" > "$dbschema"



 Great script !  
i think you can add parallel perform each couple (drop & create index).  ^^

pgsql-admin by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Notice about psql !
Next
From: "Doom.zhou"
Date:
Subject: Re: script to drop and create all indexes in a database with parameter concurrently