so follow the advice above. we need to see pg_stat_activity, and/or
pg_locks while your test is running (especially take note of pg_lock
records with granted=f)
Attached.
The database is named de. The process with procpid 3728 has the SQL query for my "main" thread--the one that reads the 12,000,000 rows one by one. procpid 6272 was handling the queries from the ~22 threads, although at the time this was taken, it was idle. But if I monitor it, I can see the queries of tables B and C going through it.
I am not clear what to read into pg_locks except that the "main" thread (3728's query) sure has a lot of locks! But all 3728 is doing is reading rows from table A, nothing else.
Aren