Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ejDBb-0008PN-7n for pgsql-general@arkaria.postgresql.org; Wed, 07 Feb 2018 00:02:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejDBZ-0004Cf-5x for pgsql-general@arkaria.postgresql.org; Wed, 07 Feb 2018 00:02:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ejDBY-0004BI-Rn for pgsql-general@lists.postgresql.org; Wed, 07 Feb 2018 00:02:00 +0000 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ejDBV-0000et-Ow for pgsql-general@postgresql.org; Wed, 07 Feb 2018 00:02:00 +0000 Received: by mail-pl0-x243.google.com with SMTP id 11so2320010plc.9 for ; Tue, 06 Feb 2018 16:01:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=tpkeRSPcxy+tNVS0UqFgqV/QTNJr32azfzXNZxgWuWQ=; b=op3UnmgUO5+/W0y8v5ASj2A1iijumGmaz72LGhEbEOtPE3jD9MNBtPWt3hlbna+2P9 H+qbwpKbeTjeEo7lORCHXLNslHo+zMN7Mf1u9ogjoUTN0H3R29b/EM7VTX83/jy6jvvL Lj8YIFz8KeXQvU0tWE4ECCkSMnv3Npo0FZXWTIDooOCNhGzdhGhrLb/J45FYc1JdKJMu wpNXc/xqfz3w4ObI5s44BrczuwPt8uQP2Zbk02GDbaW1EWSYMuUqZB6YjKEnJG1awASw D6tXfte7g6e5kcDMw9/uzUk+t17a4jwqj0leQ1IbT+mwH1IvgGuzVawDKaE2oFh+0Yg9 10Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=tpkeRSPcxy+tNVS0UqFgqV/QTNJr32azfzXNZxgWuWQ=; b=jwUI3LodCFzyS7F501musE5XgJo6vy7KSyAYSI58BLiJpjayxkj4BkuAacelRpn6ET U5HULjwe8efLZ0NfqP6kAHuANO4RES4K+nUTAJkGrLaUsxu1F8yr5g5/fak77qzkZ3bI Z8bGtdAnbd1wWlm0QWBJb8IPJKO/PEH+WSQ1KBi/fyUl4buTpWJFL3FYwVoimJ5cCgjM wt7rGfKaGh9WXRYXqN0w2BaYaMtTD1GKXSShlPkgscXbi25awW8j3cvA2rW7oNropDEx qCnTtp9R5iRtZl2g9Bjnzxtb2drEYaQUKXBkzjXOehvDVeOxI9eZHFEQMnKPr2QRluzV /dnA== X-Gm-Message-State: APf1xPAvsZGAXQTYkrMi7xwOOVr5h2fkNkwEThgO9FzuiFnuOja2w8PX Abxe4tI72Fhh7lqn/7isx3o= X-Google-Smtp-Source: AH8x227ktXCOUdlUz/v3qcCEEVbyXq69wFlTlDkmcZnsV9WSzdyArhlPbxggu6+ZxptgbFhnM59EBw== X-Received: by 2002:a17:902:2f84:: with SMTP id t4-v6mr3869688plb.81.1517961715109; Tue, 06 Feb 2018 16:01:55 -0800 (PST) Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp. [61.215.137.162]) by smtp.gmail.com with ESMTPSA id k90sm271802pfk.171.2018.02.06.16.01.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Feb 2018 16:01:53 -0800 (PST) Date: Wed, 7 Feb 2018 09:01:49 +0900 From: Michael Paquier To: Jeremy Finzel Cc: Postgres General Subject: Re: Alter table set logged hanging after writing out all WAL Message-ID: <20180207000149.GA28623@paquier.xyz> References: <20180206071948.GC74355@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PEIAKu/WMn1b1Hv9" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --PEIAKu/WMn1b1Hv9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 06, 2018 at 01:36:04AM -0600, Jeremy Finzel wrote: > Here is the basic structure - is the gist index significant?: >=20 > CREATE UNLOGGED TABLE foo ( > as_of_date daterange NOT NULL, > customer_id integer, > bunch_of_fields_here); >=20 > ALTER TABLE ONLY foo > ADD CONSTRAINT foo_as_of_date_excl EXCLUDE USING gist (customer_id WI= TH > =3D, as_of_date WITH &&); >=20 > CREATE UNIQUE INDEX foo_idx1 ON foo USING btree (customer_id) WHERE > (upper(as_of_date) =3D 'infinity'::date); >=20 > CREATE INDEX foo_idx2 ON foo USING btree (customer_id, lower(as_of_date)) > WHERE (upper(as_of_date) =3D 'infinity'::date); >=20 > 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 --PEIAKu/WMn1b1Hv9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlp6Qe0ACgkQnvQgOdby QH1/WRAAlRiVr8rp7tZPVxxC28cXtgnv58gGMRGX/ISZWCJEPyXfSXIhCWqa3h/p 5kG1Ug1YUBazoC2pOd84YieVfP5iw3EoLLxa/TztBgpSsmSZO8LLnVwS8x9y9SYi LaU3o7fNdjqS0TeOJ0TrfF2dbfdaS9CsymmN22n67AEj2DM1LYqWwUTLljF7PEAt X596nvJOvgM1h1mBot8iLLupWBrVxPbDR6iruPQcQkbSQPgoVl3hnd6cgELxM8fQ q6RNcaQWIhA7y+Yux23dZDp+Cks1vaS+aqdb+bkPZ9EBNAKeN3B9PdNfGzRm8Fqr JCKCOCooyqpWMPQblvq5hErGWIQKB4bBfP7UwTAt4cHaIIZm1wxqR1C7Pts7wXQ6 z/v5Ml2jV+XBVGf8MITx+Zln0ORgGAux11/ntF1y16u3gc/c1RvHW6zwLkUufyIl AIyS7ff3K7eDzx6k6ogw77iMkwcbKpXwPyqxPJdx3VC3f8D2tDNF0ovOPtOGypyb Pm0hcUjadVGkbTMIhe4CCA0srzO4w1xaGnVf5YU+Fcxu+iuq6pvrafH0EjpAnd5k CGYsKJGboXpQn+OK44+x/hEZv+/YMyeQygG68uFnkkqbn1LGTTPl1qHwST7OW3vO qTQBiXahjowm8XwZxSR3eK5JKZxg6t01F0cs985NFKW/E9vijQc= =+8sO -----END PGP SIGNATURE----- --PEIAKu/WMn1b1Hv9--