Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ee16I-0003RX-CZ for pgsql-docs@arkaria.postgresql.org; Tue, 23 Jan 2018 16:07:06 +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 1ee16H-0002DW-FL for pgsql-docs@arkaria.postgresql.org; Tue, 23 Jan 2018 16:07:05 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1edjBh-00053r-W9 for pgsql-docs@lists.postgresql.org; Mon, 22 Jan 2018 20:59:30 +0000 Received: from mail.letterpump.com ([206.223.185.21]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1edjBe-0000vR-7t for pgsql-docs@lists.postgresql.org; Mon, 22 Jan 2018 20:59:28 +0000 Received: from [10.37.129.2] (192.168.13.218) by mail.letterpump.com (Axigen) with (ECDHE-RSA-AES128-GCM-SHA256 encrypted) ESMTPSA id 225117; Mon, 22 Jan 2018 15:58:14 -0500 From: "Ilsa Loving" To: "Alvaro Herrera" Cc: "Michael Paquier" , "Tom Lane" , pgsql-docs@lists.postgresql.org Subject: Re: What does "Table rewrite" mean? Date: Mon, 22 Jan 2018 15:59:07 -0500 X-Mailer: MailMate (1.10r5443) Message-ID: <63910968-9247-4112-842A-F7063CD4A4C7@ilsadee.com> In-Reply-To: <20180121034750.cgfugcqbgnxxm3lg@alvherre.pgsql> References: <20180121034750.cgfugcqbgnxxm3lg@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_MailMate_1A6B07A0-0AB2-43A3-B9DC-5CB9543D09CB_=" Received-SPF: X-AXIGEN-SPF-Result: Ok List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --=_MailMate_1A6B07A0-0AB2-43A3-B9DC-5CB9543D09CB_= Content-Type: text/plain; charset=utf-8; format=flowed; markup=markdown Content-Transfer-Encoding: quoted-printable That=E2=80=99s all that=E2=80=99s needed, really. It=E2=80=99s impossibl= e to make an = informed decision if there is no way for someone to know what a table = rewrite actually does and how it does it. /*-----------------------------------------------------------------------= ----------*/ float o=3D0.075,h=3D1.5,T,r,O,l,I;/* Ilsa Loving =C2=A0 =C2=A0 =C2=A0 =C2= =A0*/int = _,L=3D80,s=3D3200; int main() {for(;s%L||(h-=3Do,T=3D-2),s;4-(r=3D/* IT Manager =C2=A0 =C2=A0 =C2=A0 =C2= =A0 = */O*O)<(l=3DI*I)|++ _=3D=3DL&& write(1,(--s%L?_ Michael Paquier wrote: >> On Fri, Jan 19, 2018 at 11:33:43AM -0500, Tom Lane wrote: >>> It means reading the whole table and writing it out in some modified >>> form (for instance, with some column transformed into a new = >>> datatype). >>> It's not "dangerous" in any way ... but if you've got many GB of = >>> data in >>> the table and you can't afford to have the table locked for a long = >>> time, >>> then it's something to avoid. >> >> Yeah that can be costly. Note that WAL corresponding to this data = >> needs >> to be generated as well. > > Maybe we need to document this somewhere, particularly now that we = > have > a "table_rewrite" event item. > > -- = > =C3=81lvaro Herrera https://www.2ndQuadrant.com/ > PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services --=_MailMate_1A6B07A0-0AB2-43A3-B9DC-5CB9543D09CB_= Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
<= p dir=3D"auto">That=E2=80=99s all that=E2=80=99s needed, really. It=E2=80= =99s impossible to make an informed decision if there is no way for someo= ne to know what a table rewrite actually does and how it does it.


/*-----------------------------------------------------------------------=
----------*/
float o=3D0.075,h=3D1.5,T,r,O,l,I;/* Ilsa Loving       &#x=
A0;*/int _,L=3D80,s=3D3200; int main()
{for(;s%L||(h-=3Do,T=3D-2),s;4-(r=3D/* IT Manager       &#=
xA0; */O*O)<(l=3DI*I)|++ _=3D=3DL&&
write(1,(--s%L?_<L?--_%6:6:7) /* The Jonah Group    */+&#x=
22;Ilsa L.\n",1)&&(O=3DI=3Dl=3D_=3Dr=3D0,
T+=3Do /2))O=3DI*2*O+h,I=3Dl+T-r;}  /* 416-304-0860x227   */

On 20 Jan 2018, at 22:47, Alvaro Herrera wrote:

Michael Paquier wrote:

On Fri, Jan= 19, 2018 at 11:33:43AM -0500, Tom Lane wrote:

It means re= ading the whole table and writing it out in some modified
form (for instance, with some column transformed into a new datatype). It's not "dangerous" in any way ... but if you've got many GB of data in<= br> the table and you can't afford to have the table locked for a long time,<= br> then it's something to avoid.

Yeah that can be costly. Note that WAL corre= sponding to this data needs
to be generated as well.

Maybe we need to document this somewhere, pa= rticularly now that we have
a "table_rewrite" event item.

--
=C3=81lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services=

--=_MailMate_1A6B07A0-0AB2-43A3-B9DC-5CB9543D09CB_=--