pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Maciek Sakrejda <m.sakrejda@gmail.com>
Cc: Claudio Freire <klaussfreire@gmail.com>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: Anibal David Acosta <aa@devshock.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: how to avoid deadlock on masive update with multiples delete
Date: Fri, 05 Oct 2012 11:31:43 -0400
Message-ID: <9895.1349451103@sss.pgh.pa.us> (raw)
In-Reply-To: <CAOtHd0A0UNJYTeVDsn6uY2d-6f2+=s5EkQFwNV0ASa4PqAk8yw@mail.gmail.com>
References: <005701cda238$ba4d0350$2ee709f0$@devshock.com>
	<CAMkU=1x_tM6ujEY39FUk=Lj2=NoT+-vJzoFMtwuKPN8Jd5PqrQ@mail.gmail.com>
	<CAGTBQpbK3K56Jzx_xU3ch1QB2TcnbwmQUd0T_98V6BoScGHOMg@mail.gmail.com>
	<CAOtHd0A0UNJYTeVDsn6uY2d-6f2+=s5EkQFwNV0ASa4PqAk8yw@mail.gmail.com>

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




view thread (13+ messages)  latest in thread

Message-ID: <9895.1349451103@sss.pgh.pa.us>
Permalink:  ../9895.1349451103@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9895.1349451103@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, m.sakrejda@gmail.com, klaussfreire@gmail.com, jeff.janes@gmail.com, aa@devshock.com
  Subject: Re: how to avoid deadlock on masive update with multiples delete
  In-Reply-To: <9895.1349451103@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox