pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: Mariel Cherkassky <mariel.cherkassky@gmail.com>
Cc: Andreas Kretschmer <andreas@a-kretschmer.de>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: trying to delete most of the table by range of date col
Date: Mon, 3 Sep 2018 04:23:01 -0500
Message-ID: <20180903092300.GC11702@telsasoft.com> (raw)
In-Reply-To: <CA+t6e1=VV2M8Fqm0txKrof4s-OscLzuGu7Ekq5HnNSZL-GKM_w@mail.gmail.com>
References: <CA+t6e1krNiXeqbXPi7pSYA8vvu7KsRCcE8yexzFBGrnBhS7sZg@mail.gmail.com>
	<20180903070624.GA11702@telsasoft.com>
	<4a0271e9-df9e-680e-9b21-636763cb674f@a-kretschmer.de>
	<CA+t6e1=VV2M8Fqm0txKrof4s-OscLzuGu7Ekq5HnNSZL-GKM_w@mail.gmail.com>

On Mon, Sep 03, 2018 at 11:17:58AM +0300, Mariel Cherkassky wrote:
> Hi,
> I already checked and on all the tables that uses the id col of the main
> table as a foreign key have index on that column.
> 
> So, it seems that the second solution is the fastest one. It there a reason
> why the delete chunks (solution 4) wasnt faster?

I suggest running:

SET track_io_timing=on; -- requires superuser
explain(ANALYZE,BUFFERS) DELETE [...]

https://wiki.postgresql.org/wiki/Slow_Query_Questions

Maybe you just need larger shared_buffers ?

Justin




view thread (13+ messages)  latest in thread

Message-ID: <20180903092300.GC11702@telsasoft.com>
Permalink:  ../20180903092300.GC11702@telsasoft.com/
Also on:    postgresql.org/message-id/20180903092300.GC11702@telsasoft.com

 · 

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: pryzby@telsasoft.com, mariel.cherkassky@gmail.com, andreas@a-kretschmer.de, pgsql-performance@lists.postgresql.org
  Subject: Re: trying to delete most of the table by range of date col
  In-Reply-To: <20180903092300.GC11702@telsasoft.com>

* 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