Re: alter table xxx set unlogged take long time

2022-07-27 Thread Kyotaro Horiguchi
At Tue, 26 Jul 2022 12:41:07 +, "James Pang (chaolpan)" wrote in > How to make it fast ? These are our steps about copy large data from Oracle > to Postgres > > 1. Create table in Postgres 2. Extract data from Oracle to CSV 3. Alter > table set xxx unlogged, 4. Run copy command in

Re: Postgresql 14 partitioning advice

2022-07-27 Thread Jeff Janes
On Wed, Jul 27, 2022 at 8:55 AM Rick Otten wrote: > > One person I talked to said "try not to have more than 100 partitions", > even with the latest postgresql you'll end up with a lot of lock contention > if you go over 100 partitions. > > It is hard to know how seriously to take the advice of a

Re: alter table xxx set unlogged take long time

2022-07-27 Thread Joe Conway
On 7/27/22 10:46, Tom Lane wrote: Joe Conway writes: Then (completely untested) I *think* you could create the "partition" initially as a free standing unlogged table, load it, index it, switch to logged, and then attach it to the partitioned table. I'm still of the opinion that this plan to

Re: alter table xxx set unlogged take long time

2022-07-27 Thread Tom Lane
Joe Conway writes: > Then (completely untested) I *think* you could create the "partition" > initially as a free standing unlogged table, load it, index it, switch > to logged, and then attach it to the partitioned table. I'm still of the opinion that this plan to load the data unlogged and swi

Re: alter table xxx set unlogged take long time

2022-07-27 Thread Joe Conway
On 7/26/22 08:59, James Pang (chaolpan) wrote:    We use JDBC to export data into csv ,then copy that to Postgres. Multiple sessions working on multiple tables.  If not set unlogged , how to make COPY run fast ?   possible to start a transaction include all of these  “truncate table xxx; copy

Re: Postgresql 14 partitioning advice

2022-07-27 Thread Justin Pryzby
On Wed, Jul 27, 2022 at 08:55:14AM -0400, Rick Otten wrote: > I'm spinning up a new Postgresql 14 database where I'll have to store a > couple years worth of time series data at the rate of single-digit millions > of rows per day. Since this has to run in AWS Aurora, I can't use > TimescaleDB. >

Postgresql 14 partitioning advice

2022-07-27 Thread Rick Otten
I'm spinning up a new Postgresql 14 database where I'll have to store a couple years worth of time series data at the rate of single-digit millions of rows per day. Since this has to run in AWS Aurora, I can't use TimescaleDB. I've been soliciting advice for best practices for building this. One