From: Michael Paquier <michael.paquier@gmail.com>
To: Jeremy Finzel <finzelj@gmail.com>
Cc: Postgres General <pgsql-general@postgresql.org>
Subject: Re: Alter table set logged hanging after writing out all WAL
Date: Wed, 7 Feb 2018 09:01:49 +0900
Message-ID: <20180207000149.GA28623@paquier.xyz> (raw)
In-Reply-To: <CAMa1XUgkh4UKfDbPoQ3x92pNWGY2M1zJoS0G5pVpDpjRGjLZtA@mail.gmail.com>
References: <CAMa1XUg=9YKo4_VgVNWJZVt7MsKEnui5VnRKL1cyVbJgnmUG9g@mail.gmail.com>
<20180206071948.GC74355@paquier.xyz>
<CAMa1XUgkh4UKfDbPoQ3x92pNWGY2M1zJoS0G5pVpDpjRGjLZtA@mail.gmail.com>
On Tue, Feb 06, 2018 at 01:36:04AM -0600, Jeremy Finzel wrote:
> Here is the basic structure - is the gist index significant?:
>
> CREATE UNLOGGED TABLE foo (
> as_of_date daterange NOT NULL,
> customer_id integer,
> bunch_of_fields_here);
>
> ALTER TABLE ONLY foo
> ADD CONSTRAINT foo_as_of_date_excl EXCLUDE USING gist (customer_id WITH
> =, as_of_date WITH &&);
>
> CREATE UNIQUE INDEX foo_idx1 ON foo USING btree (customer_id) WHERE
> (upper(as_of_date) = 'infinity'::date);
>
> CREATE INDEX foo_idx2 ON foo USING btree (customer_id, lower(as_of_date))
> WHERE (upper(as_of_date) = 'infinity'::date);
>
> CREATE UNIQUE INDEX foo_idx3 ON foo USING btree (customer_id,
> lower(as_of_date));
I am not sure, but I would think about something related to gist here
when heavy insertions are done on it... I cannot put my finger on the
thread though.
> This is all I see - please help me if there's a better command I can
> run:
If the process is still running, can you attach gdb to it and then run
the command bt? You may need to install debugging symbols to make the
trace readable.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: michael.paquier@gmail.com, finzelj@gmail.com
Subject: Re: Alter table set logged hanging after writing out all WAL
In-Reply-To: <20180207000149.GA28623@paquier.xyz>
References: <CAMa1XUg=9YKo4_VgVNWJZVt7MsKEnui5VnRKL1cyVbJgnmUG9g@mail.gmail.com> <20180206071948.GC74355@paquier.xyz> <CAMa1XUgkh4UKfDbPoQ3x92pNWGY2M1zJoS0G5pVpDpjRGjLZtA@mail.gmail.com> <20180207000149.GA28623@paquier.xyz>
* 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