Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
357 views
in Technique[技术] by (71.8m points)

database - Postgres SQL Update JDBC Stuck

I'm running the below query through jdbcTemplate.update()

"UPDATE <tblnme>  as aa set _r=b._r from(SELECT id,parent,LEAD(id,1) OVER (partition by parent ORDER BY id) _r from <tblnme>) as b where aa.id=b.id"

This update (1 table - 28 million records) runs fine around 15 min on below m.c config

SSD 32 GB RAM Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz 2.80 GHz

but gets stuck in below m.c config

HHD 32 GB RAM Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz 3.41 GHz

There's no message in postgres server log during the stuck phase. Had to terminate after 4 hrs wait.

have set below in postgresql.conf in both m/c:

a. max_connections = 375 b. shared_buffers = 2500MB c. max_wal_size = 16GB d. min_wal_size = 4096MB

What could be done to resolve this issue?

question from:https://stackoverflow.com/questions/65945461/postgres-sql-update-jdbc-stuck

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...