Re: reindexing db

Поиск
Список
Период
Сортировка
От Ron
Тема Re: reindexing db
Дата
Msg-id 98c19d44-8d4c-f608-5432-eef048965552@gmail.com
обсуждение исходный текст
Ответ на Re: reindexing db  (Paul Förster <paul.foerster@gmail.com>)
Ответы Re: reindexing db
Список pgsql-admin


On 12/8/20 1:21 AM, Paul Förster wrote:
Hi Ron,

On 08. Dec, 2020, at 07:59, Ron <ronljohnsonjr@gmail.com> wrote:

Probably a habit from my VAX/VMS days, but I prefer to enumerate every table, not only for tracking but so that if the command fails 90% of the way through, I can skip over the the completed portions.
doing this IMHO defeats the purpose of concurrency because you'd have to issue reindex statements sequentially. Also, but I definitely can't say for sure, reindexdb should skip and report indexes which it has a problem with and then continue to do the remaining indexes. But as I said, I may be wrong with this.

The CONCURRENTLY clause is about rebuilding an index online instead of blocking all other access to the table, not about reindexing multiple tables in parallel.

Thus, it's perfectly valid to write something like

DB=test
while read line;
do
    psql $DB "REINDEX TABLE $line CONCURRENTLY;"
done < list_of_tables.txt


You might also be able to play with GNU Parallel and concurrently run multiple "REINDEX TABLE $line CONCURRENTLY;" statements.

--
Angular momentum makes the world go 'round.

В списке pgsql-admin по дате отправления:

Предыдущее
От: Paul Förster
Дата:
Сообщение: Re: reindexing db
Следующее
От: Paul Förster
Дата:
Сообщение: Re: reindexing db