Re: how to avoid deadlock on masive update with multiples delete - Mailing list pgsql-performance

From Tom Lane
Subject Re: how to avoid deadlock on masive update with multiples delete
Date
Msg-id 9895.1349451103@sss.pgh.pa.us
Whole thread Raw
In response to Re: how to avoid deadlock on masive update with multiples delete  (Maciek Sakrejda <m.sakrejda@gmail.com>)
Responses Re: how to avoid deadlock on masive update with multiples delete  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-performance
Maciek Sakrejda <m.sakrejda@gmail.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


pgsql-performance by date:

Previous
From: Maciek Sakrejda
Date:
Subject: Re: how to avoid deadlock on masive update with multiples delete
Next
From: Andres Freund
Date:
Subject: Re: how to avoid deadlock on masive update with multiples delete