Skip site navigation (1) Skip section navigation (2)

Re: how to avoid deadlock on masive update with multiples delete

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Maciek Sakrejda <m(dot)sakrejda(at)gmail(dot)com>
Cc: Claudio Freire <klaussfreire(at)gmail(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Anibal David Acosta <aa(at)devshock(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: how to avoid deadlock on masive update with multiples delete
Date: 2012-10-05 15:31:43
Message-ID: 9895.1349451103@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Maciek Sakrejda <m(dot)sakrejda(at)gmail(dot)com> writes:
> Presumably something like this?:
> maciek=# CREATE TABLE test AS SELECT g, random() FROM
> generate_series(1,1000) g;
> CREATE
> maciek=# EXPLAIN DELETE FROM test USING (SELECT g FROM test ORDER BY
> ctid) x where x.g = test.g;

There's no guarantee that the planner won't re-sort the rows coming from
the sub-select, unfortunately.

			regards, tom lane


In response to

Responses

pgsql-performance by date

Next:From: Andres FreundDate: 2012-10-05 15:36:14
Subject: Re: how to avoid deadlock on masive update with multiples delete
Previous:From: Maciek SakrejdaDate: 2012-10-05 15:08:19
Subject: Re: how to avoid deadlock on masive update with multiples delete

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group