Re: Slow Bulk Delete
От | thilo |
---|---|
Тема | Re: Slow Bulk Delete |
Дата | |
Msg-id | a79c1af7-8ef3-4d9a-9341-c9ff7299dd4a@b18g2000yqb.googlegroups.com обсуждение исходный текст |
Ответ на | Re: Slow Bulk Delete (Andy Colson <andy@squeakycode.net>) |
Список | pgsql-performance |
Hi Andy! Thanks a lot for your hints! Indeed the problem was on my side. Some Hibernate tuning solved the problem (and I was able to speedup the query using IN). The real problem was that Hibernate using unprepared queries if you create a native query, but prepares the query if you use JP-QL (very odd behavior). Thanks anyway for your help! Kind regards Thilo > I am going to guess the slow part is sending 1M different queries back and forth from client to server. You could trybatching them together: > > DELETE FROM table1 WHERE table2_id in (11242939, 1,2,3,4,5...., 42); > > Also are you preparing the query? > > -Andy > > -- > Sent via pgsql-performance mailing list (pgsql-performa...@postgresql.org) > To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-performance
В списке pgsql-performance по дате отправления: