public inbox for [email protected]
help / color / mirror / Atom feedFrom: Lok P <[email protected]>
To: pgsql-general <[email protected]>
Subject: Creating big indexes
Date: Sat, 8 Jun 2024 12:53:03 +0530
Message-ID: <CAKna9VaOt_FPSSdMQaF0abiAPLdN1jB9renORV+ky2mP1_nDRw@mail.gmail.com> (raw)
Hello,
We have a few tables having size ~5TB and are partitioned on a timestamp
column. They have ~90 partitions in them and are storing 90 days of data.
We want to create a couple of indexes on those tables. They are getting the
incoming transactions(mainly inserts) 24/7 , which are mostly happening on
the current day/live partition. Its RDS postgres version 15.4. So in this
situation
Should we go with below i.e one time create index command on the table..
CREATE INDEX CONCURRENTLY idx1 ON tab(column_name);
Or
create index on individual partitions from different sessions, say for
example create indexes on 30 partitions each from three different sessions
so as to finish all the 90 partitions faster?
CREATE INDEX CONCURRENTLY idx1 ON tab_part1(column_name);
CREATE INDEX CONCURRENTLY idx1 ON tab_part2(column_name);
.....
.....
Basically I have three questions:
1)If we can do this index creation activity online without impacting the
incoming transactions or do we have to take down time for this activity?
2)If we can't do it online then , what is the fastest method to do this
index creation activity ?
3)Should we change the DB parameters in a certain way to make the process
faster? We have currently set below parameters
max_parallel_workers-16
max_parallel_maintenance_workers-2
maintenance_work_mem- 4GB
Regards
Lok
view thread (3+ messages) latest in thread
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: [email protected]
Cc: [email protected], [email protected]
Subject: Re: Creating big indexes
In-Reply-To: <CAKna9VaOt_FPSSdMQaF0abiAPLdN1jB9renORV+ky2mP1_nDRw@mail.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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox