On Wed, 2025-07-23 at 11:55 +0000, sivapostgres@yahoo.com wrote:
> 1. I tried running Copy From command from PGAdmin.
> 2. I ran pg_stat_activity also in another tab [ PGAdmin ].
>
> What I observed,
> 1. In about 2 min, in the Dashboard of PGAdmin, the colour changed to Orange for that particular pid.
> 2. After few seconds, the colour again changed to Red.
> 3. The stat column in both Dashboard and pg_stat_activity.state shows 'active'.
> 4. No messages relevant to this pid in postgres' log files
> 5. CPU usage is normal, hovering around 36% overall, 15-18% for postgresql server, from the beginning and even after
3min.
> 6. We didn't run any other application in that machine.
> 7. Unique Index is there in table2 which will return only one row for that Select Count(*) query.
> 8. No record is there in the target table when transfer started. This transfer is the first batch for that
particulartable.
> 9. Once color turned into Red, I could cancel the query execuion in PGAdmin, which immediately stops the execution.
> 10. I could not see any locks or blocking pids.
As far as I know, red in pgAdmin (I don't use it) *is* the indication for a wait event.
So look again what the columns "wait_event_type" and "wait_event" in "pg_stat_activity" show.
Yours,
Laurenz Albe