Re: Slow Bulk Delete - Mailing list pgsql-performance

From thilo
Subject Re: Slow Bulk Delete
Date
Msg-id a79c1af7-8ef3-4d9a-9341-c9ff7299dd4a@b18g2000yqb.googlegroups.com
Whole thread Raw
In response to Re: Slow Bulk Delete  (Andy Colson <andy@squeakycode.net>)
List 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 by date:

Previous
From: Jignesh Shah
Date:
Subject: Re: 8K recordsize bad on ZFS?
Next
From: venu madhav
Date:
Subject: Performance issues when the number of records are around 10 Million