Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6LwF-0004Z2-Qi for pgsql-admin@arkaria.postgresql.org; Tue, 19 Mar 2019 21:06:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h6LwC-0001KS-FO for pgsql-admin@arkaria.postgresql.org; Tue, 19 Mar 2019 21:06:20 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6LwC-0001H5-5f for pgsql-admin@lists.postgresql.org; Tue, 19 Mar 2019 21:06:20 +0000 Received: from mail-out.m-online.net ([212.18.0.9]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6Lw5-0007nS-Mv for pgsql-admin@lists.postgresql.org; Tue, 19 Mar 2019 21:06:19 +0000 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 44P5FJ56Lfz1rWJ7 for ; Tue, 19 Mar 2019 22:06:12 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 44P5FJ2swsz1qrvh for ; Tue, 19 Mar 2019 22:06:12 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 9KdHFkRzE7Bc for ; Tue, 19 Mar 2019 22:06:11 +0100 (CET) Received: from [192.168.178.37] (ppp-93-104-77-208.dynamic.mnet-online.de [93.104.77.208]) by mail.mnet-online.de (Postfix) with ESMTP for ; Tue, 19 Mar 2019 22:06:11 +0100 (CET) Subject: Re: Adding Column on Huge Table To: pgsql-admin@lists.postgresql.org References: <5b26ed21-a7b5-6c1b-af10-10df4d44a4f7@gmail.com> <20190319205251.GC2983@typhoon> From: Thomas Kellerer Message-ID: Date: Tue, 19 Mar 2019 22:06:12 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <20190319205251.GC2983@typhoon> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alex Balashov schrieb am 19.03.2019 um 21:52: > My experience is that adding a column is a rather quick operation even > on quite large tables, _unless_ the column has a default value, in which > case that default value is set for every row. In that case, the time > required for the operation converges with that of a mass-UPDATE. Which has changed with Postgres 11, where adding a default value does not update all rows in the table.