pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Paul Förster <paul.foerster@gmail.com>
To: Ron <ronljohnsonjr@gmail.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: reindexing db
Date: Tue, 8 Dec 2020 08:46:39 +0100
Message-ID: <01FAC841-0FF0-4B63-A507-C76EFB62A97F@gmail.com> (raw)
In-Reply-To: <98c19d44-8d4c-f608-5432-eef048965552@gmail.com>
References: <292966DF-135C-4483-81A9-5027FC3C8A82@elevated-dev.com>
	<f477709e-6371-1ba3-84df-37e5df8e5d83@gmail.com>
	<214E5DBC-1F6F-49C1-8B83-9A2EB33E969A@gmail.com>
	<39a8cdb5-bfbb-9ae8-5867-c4234373277c@gmail.com>
	<A54CA469-6EAA-40AD-AD37-7E877268786A@gmail.com>
	<98c19d44-8d4c-f608-5432-eef048965552@gmail.com>

Hi Ron,

> On 08. Dec, 2020, at 08:42, Ron <ronljohnsonjr@gmail.com> wrote:
> 
> DB=test
> while read line; 
> do 
>     psql $DB "REINDEX TABLE $line CONCURRENTLY;" 
> done < list_of_tables.txt

yes, you can do that of course. In this case, I would add an "&" after the psql and probably a "wait" at the end. This should get the job done in parallel. :-)

That of course depends on how fast the machine is and how much load it can take. :-)

Cheers,
Paul




view thread (17+ messages)  latest in thread

Message-ID: <01FAC841-0FF0-4B63-A507-C76EFB62A97F@gmail.com>
Permalink:  ../01FAC841-0FF0-4B63-A507-C76EFB62A97F@gmail.com/
Also on:    postgresql.org/message-id/01FAC841-0FF0-4B63-A507-C76EFB62A97F@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: paul.foerster@gmail.com, ronljohnsonjr@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: reindexing db
  In-Reply-To: <01FAC841-0FF0-4B63-A507-C76EFB62A97F@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox