Re: [PERFORM] Slow Bulk Delete

2010-05-17 Thread Jon Nelson
On Mon, May 17, 2010 at 7:28 AM, A. Kretschmer wrote: > In response to Jon Nelson : >> On Mon, May 17, 2010 at 5:10 AM, Pierre C wrote: >> > - or use a JOIN delete with a virtual VALUES table >> > - or fill a temp table with ids and use a JOIN DELETE >> >> What is a virtual VALUES table? Can you

Re: [PERFORM] Slow Bulk Delete

2010-05-17 Thread Grzegorz Jaśkiewicz
again VALUES(1,2), (2,3), ; is a 'virtual table', as he calls it. It really is not a table to postgresql. I guess he is just using that naming convention. -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.

Re: [PERFORM] Slow Bulk Delete

2010-05-17 Thread Jon Nelson
2010/5/17 Віталій Тимчишин : > > > 2010/5/17 Jon Nelson >> >> On Mon, May 17, 2010 at 5:10 AM, Pierre C wrote: >> > - or use a JOIN delete with a virtual VALUES table >> > - or fill a temp table with ids and use a JOIN DELETE >> >> What is a virtual VALUES table? Can you give me an example of usi

Re: [PERFORM] Slow Bulk Delete

2010-05-17 Thread A. Kretschmer
In response to Jon Nelson : > On Mon, May 17, 2010 at 5:10 AM, Pierre C wrote: > > - or use a JOIN delete with a virtual VALUES table > > - or fill a temp table with ids and use a JOIN DELETE > > What is a virtual VALUES table? Can you give me an example of using a > virtual table with selects, j

Re: [PERFORM] Slow Bulk Delete

2010-05-17 Thread Grzegorz Jaśkiewicz
On Mon, May 17, 2010 at 12:54 PM, Jon Nelson wrote: > On Mon, May 17, 2010 at 5:10 AM, Pierre C wrote: >> - or use a JOIN delete with a virtual VALUES table >> - or fill a temp table with ids and use a JOIN DELETE > > What is a virtual VALUES table? Can you give me an example of using a > virtual

Re: [PERFORM] Slow Bulk Delete

2010-05-17 Thread Віталій Тимчишин
2010/5/17 Jon Nelson > > On Mon, May 17, 2010 at 5:10 AM, Pierre C wrote: > > - or use a JOIN delete with a virtual VALUES table > > - or fill a temp table with ids and use a JOIN DELETE > > What is a virtual VALUES table? Can you give me an example of using a > virtual table with selects, joins

Re: [PERFORM] Slow Bulk Delete

2010-05-17 Thread Jon Nelson
On Mon, May 17, 2010 at 5:10 AM, Pierre C wrote: > - or use a JOIN delete with a virtual VALUES table > - or fill a temp table with ids and use a JOIN DELETE What is a virtual VALUES table? Can you give me an example of using a virtual table with selects, joins, and also deletes? -- Jon -- Se

Re: [PERFORM] Slow Bulk Delete

2010-05-17 Thread Pierre C
DELETE FROM table1 WHERE table2_id = ? For bulk deletes, try : DELETE FROM table1 WHERE table2_id IN (list of a few thousands ids) - or use a JOIN delete with a virtual VALUES table - or fill a temp table with ids and use a JOIN DELETE This will save cliet/server roundtrips. Now, something t

Re: [PERFORM] Slow Bulk Delete

2010-05-12 Thread Bob Lunney
: > From: thilo > Subject: [PERFORM] Slow Bulk Delete > To: pgsql-performance@postgresql.org > Date: Saturday, May 8, 2010, 7:39 AM > Hi all! > > We moved from MySQL to Postgresql for some of our projects. > So far > we're very impressed with the performance (es

Re: [PERFORM] Slow Bulk Delete

2010-05-11 Thread thilo
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 (ver

[PERFORM] Slow Bulk Delete

2010-05-11 Thread thilo
Hi all! We moved from MySQL to Postgresql for some of our projects. So far we're very impressed with the performance (especially INSERTs and UPDATEs), except for a strange problem with the following bulk delete query: DELETE FROM table1 WHERE table2_id = ? I went through these Wiki pages, trying

Re: [PERFORM] Slow Bulk Delete

2010-05-08 Thread Andy Colson
On 05/08/2010 06:39 AM, thilo wrote: Hi all! We moved from MySQL to Postgresql for some of our projects. So far we're very impressed with the performance (especially INSERTs and UPDATEs), except for a strange problem with the following bulk delete query: DELETE FROM table1 WHERE table2_id = ?