Re: How long does iteration over 4-5 million rows usually take?

2022-04-02 Thread Rob Sargent
> On Apr 1, 2022, at 10:18 PM, Ron wrote: > >  On 4/1/22 20:34, Shaozhong SHI wrote: >> >> I have a script running to iterate over 4-5 million rows. It keeps showing >> up in red in PgAdmin. It remains active. >> >> How long does iteration over 4-5 million rows usually take? 4-5 million

Aw: Re: How long does iteration over 4-5 million rows usually take?

2022-04-02 Thread Karsten Hilbert
> > On Apr 1, 2022, at 10:18 PM, Ron wrote: > > > >  On 4/1/22 20:34, Shaozhong SHI wrote: > >> > >> I have a script running to iterate over 4-5 million rows. It keeps > >> showing up in red in PgAdmin. It remains active. > >> > >> How long does iteration over 4-5 million rows usually take?

Re: Re: How long does iteration over 4-5 million rows usually take?

2022-04-02 Thread Shaozhong SHI
Thanks, Karsten, I would like the information to work planning purpose. Regards, David On Sat, 2 Apr 2022 at 14:47, Karsten Hilbert wrote: > > > On Apr 1, 2022, at 10:18 PM, Ron wrote: > > > > > >  On 4/1/22 20:34, Shaozhong SHI wrote: > > >> > > >> I have a script running to iterate over 4

Re: Re: How long does iteration over 4-5 million rows usually take?

2022-04-02 Thread Benedict Holland
For work planning, create a temporary table, copy from a generated data set, and test it out. It really depends. Normally, you don't iterate in SQL since rows are assumed to be independent. You think about SQL in terms of sets and let application code handle the data transfers. It also really depen

Re: weird issue with occasional stuck queries

2022-04-02 Thread spiral
Hey, > That wait event according to documentation is "Waiting to access the > multixact member SLRU cache." SLRU = segmented least recently used > cache I see, thanks! > if you are low on memory, it can slow down the allocation of > buffers. Do you have a query that is a "select for update" run

Re: weird issue with occasional stuck queries

2022-04-02 Thread Adam Scott
The logs were helpful. You may want to see the statements around the errors, as more detail may be there such as the SQL statement associated with the error. Deadlocks are an indicator that the client code needs to be examined for improvement. See https://www.cybertec-postgresql.com/en/postgres

Re: weird issue with occasional stuck queries

2022-04-02 Thread overland
I would look at optimizing the query to increase performance. SELECT * has room for improvement.  Also check out the book Mastering PostgreSQL 11 (or whatever version). There are some good tips in there like using EXPLAIN to analyze the query plan.  Looking at/setting max_parallel_workers_per_gat