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 1ejdAo-0004lc-AK for pgsql-general@arkaria.postgresql.org; Thu, 08 Feb 2018 03:46:58 +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 1ejdAn-0006GY-D2 for pgsql-general@arkaria.postgresql.org; Thu, 08 Feb 2018 03:46:57 +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 1ejdAn-0006GO-1R for pgsql-general@lists.postgresql.org; Thu, 08 Feb 2018 03:46:57 +0000 Received: from mail-it0-x241.google.com ([2607:f8b0:4001:c0b::241]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ejdAk-0007DH-25 for pgsql-general@postgresql.org; Thu, 08 Feb 2018 03:46:56 +0000 Received: by mail-it0-x241.google.com with SMTP id n206so4847132itg.1 for ; Wed, 07 Feb 2018 19:46:53 -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=1iBmE+kmaJfombGagxmqACZtCx6g4rotD0JO1eHXD7k=; b=sD2talkFwr80qEPNL+dHVOQwBgefRDLtbU3jbqZVW6SzWYtaBXyiFoM0qiTai9/uXs KS7sVu4DhAykPR+osBWHinjGCY5qSJs59UQpRUVyMHVmbvFk9T+95fwbcKKukPY3N2du F0XYbPej5j+oupUyZixaK0QSvmJMzJFpQRXvPF2oF0TlzFz+4JN/c8uH1Ubu0AikSbY1 zJMXHgm9tPgrcIPXxUo9IQ+CwX+rzBH9TAISixQ8QUsURqBUsoQG1z0yUkYAhORSn1Nm +9IoxDJSoCnyswwDeqs9ySi+UAafRyJ0JVJxjxJNX8rcQ2IkU59lQagDAuwu/GMJJXAB BywQ== 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=1iBmE+kmaJfombGagxmqACZtCx6g4rotD0JO1eHXD7k=; b=IHkYqYaemy0EK0z+kNb9W4v1fyaeh/uTCg1i4kvor4JNVsxJ5XepoW3cTLuSI738ej F7hBryG5e9ua9ImespniR9MnPQuBVF/UxhoWuGxo32iyAEVif1B1c0TBYgmUyMTAOAMj 0CL3c6ipzjV4z5uzHwy2E7VWi3d+QfrJ/+T4rsVdSqmvC3QmChgY50T2WNTxXvU1bKsP 75Q4j5Zkwpvhj8x2ncRM6ERZ9ARIaXFaLpAj2Q3jTTMCrs/Obb233zjYFmXr+8fIJZEP qRF7tIG6oqadzCew9ZJ2EwGCUMOZmbCSvSw36BnM2nxXf3Rtd5QMvgRNONCgv9z9CNJ2 gaxg== X-Gm-Message-State: APf1xPBl3SK1eDZ0/1Rn6Jfi5ko12YUD9Jp/rjeX7aHdAv0U9EKm8wdW fGGNz7pZk9MhBDAJ5Zs7gxp8AZyD X-Google-Smtp-Source: AH8x224Ao7OaqoDblOmR4NSqjN7V2HJqQwl/RFjJPwuEDtf+MCSIHSIbXIZeo9CvxoVbjQNIk3CMow== X-Received: by 10.36.253.6 with SMTP id m6mr11179553ith.132.1518061611757; Wed, 07 Feb 2018 19:46:51 -0800 (PST) Received: from paquier.xyz (mp76f1f981.ap.nuro.jp. [118.241.249.129]) by smtp.gmail.com with ESMTPSA id w192sm2792182iof.32.2018.02.07.19.46.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Feb 2018 19:46:50 -0800 (PST) Date: Thu, 8 Feb 2018 12:46:38 +0900 From: Michael Paquier To: Jeremy Finzel Cc: Postgres General Subject: Re: Alter table set logged hanging after writing out all WAL Message-ID: <20180208034638.GD6599@paquier.xyz> References: <20180206071948.GC74355@paquier.xyz> <20180207000149.GA28623@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2qXFWqzzG3v1+95a" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --2qXFWqzzG3v1+95a Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Feb 07, 2018 at 11:35:13AM -0600, Jeremy Finzel wrote: > I was able to get it to finish by just waiting awhile. To give you an > idea, the table with no indexes was set logged in 7 minutes. With the gist > index, it took 3 hours but finally finished. It is only writing WAL for > about the first 30 minutes, then it apparently is not writing any more WAL > but takes very long to finish. An idea to reduce the activity would be to temporarily run PostgreSQL on scissors, by for example disabling full_page_writes and wal_level = minimal, but don't do that if other sessions are running in parallel, and take proper backups before doing it. -- Michael --2qXFWqzzG3v1+95a Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlp7yB4ACgkQnvQgOdby QH2fRg/+NupSJQtGb5aUIySjPK4Y2mPBG03Z7cW9MaqINXBS7RbytiF4EZpGPrzC ZrMqndRcQOWWmht0FDRdzqm0JJ87aEyez6lsAN5xaDQMu5bxUZKAq5/fTxPYk+OH oBjjbu+NxljYze9UGRwUL51gdPYw3BMkT9SIGxSIuAmpnCopFmaNZ6L3DQhkWYdq Q8u4OcWhQABnyd5PiXa0rAoSFMrpkhljDZ7FPp5TAjzQ5CEAd9sSrMRhDpt6TnH8 etv5sKGgbZxO87ZKyjYKBQ7Qasyo81goZfnhDXP4W3/mpLVDIeasysI+zvTwCChp v7WOVuHhwo2FrcRwoEsVFtQHBgFBV8JUFWGBCajoGbF/mN9rBC+R13uZFjxUd3HR Qio/PeiVz4lGfjg1Y4uL6j1gGlnWQyn4+9x4PCARK4C/4HAZik/l9ORcRTEZ9qad 1YwNDCLSUZs8QE+hydChT7aSERuQESFa9b59ZBfvTk+DLtD7NNe2RYKMcdz12Ift 58vp1YTkTFEsFKP6EUmszYTntMut1+uI96gXr1TmvxuXXgSll9FWn0YhErbZqchP MiUSAOZueNsozZQil1XSnR069s7tcQAeNHL9ZZR6FzxR85DcHJ/Sb2a8q0rvcBB5 tp8cHfKAZNIkRrKkUQWjflOfaS2NiXWkCi0McgrfjnX+hc5pl9Q= =CbEt -----END PGP SIGNATURE----- --2qXFWqzzG3v1+95a--