Re: ITYM DROP TABLE

Lists: pgsql-hackers
From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: ITYM DROP TABLE
Date: 2011-06-13 21:44:05
Message-ID: 79A3A7F7-4448-4927-A1ED-104EF2B360D8@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I was reading the partitioning docs when I spotted this. I think it means to highlight the advantages of DROP TABLE over DELETE rather than ALTER TABLE.

Best,

David

diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index 4c9fc5d..0cdb800 100644
*** a/doc/src/sgml/ddl.sgml
--- b/doc/src/sgml/ddl.sgml
*************** VALUES ('New York', NULL, NULL, 'NY');
*** 2332,2338 ****
<para>
Bulk loads and deletes can be accomplished by adding or removing
partitions, if that requirement is planned into the partitioning design.
! <command>ALTER TABLE</> is far faster than a bulk operation.
It also entirely avoids the <command>VACUUM</command>
overhead caused by a bulk <command>DELETE</>.
</para>
--- 2332,2338 ----
<para>
Bulk loads and deletes can be accomplished by adding or removing
partitions, if that requirement is planned into the partitioning design.
! <command>DROP TABLE</> is far faster than a bulk operation.
It also entirely avoids the <command>VACUUM</command>
overhead caused by a bulk <command>DELETE</>.
</para>


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ITYM DROP TABLE
Date: 2011-06-14 12:52:59
Message-ID: BANLkTikxyt0o-0Jd6Q6Cgn-n+2xkT_HVHw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Jun 13, 2011 at 5:44 PM, David E. Wheeler <david(at)kineticode(dot)com> wrote:
> I was reading the partitioning docs when I spotted this. I think it means to highlight the advantages of DROP TABLE over DELETE rather than ALTER TABLE.

I guess they might mean ALTER TABLE .. NO INHERIT. But I think I
agree that DROP TABLE would be better.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: David E(dot) Wheeler <david(at)kineticode(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ITYM DROP TABLE
Date: 2011-06-14 14:35:53
Message-ID: 1308061763-sup-6477@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Excerpts from David E. Wheeler's message of lun jun 13 17:44:05 -0400 2011:
> I was reading the partitioning docs when I spotted this. I think it means to highlight the advantages of DROP TABLE over DELETE rather than ALTER TABLE.

I think the point of the existing wording is to point out
ALTER TABLE / NO INHERIT. I wonder if it's worth expanding the text to
mention both, such as

--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -2320,7 +2320,9 @@ VALUES ('New York', NULL, NULL, 'NY');
<para>
Bulk loads and deletes can be accomplished by adding or removing
partitions, if that requirement is planned into the partitioning design.
- <command>ALTER TABLE</> is far faster than a bulk operation.
+ <command>ALTER TABLE</> (to split out a sub-table from the partitioned
+ table) and <command>DROP TABLE</> (to remove a partition altogether) are
+ both far faster than a bulk operation.
It also entirely avoids the <command>VACUUM</command>
overhead caused by a bulk <command>DELETE</>.
</para>

However, this introductory text is supposed to be very brief; maybe we
should remove mention of specific commands here.

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ITYM DROP TABLE
Date: 2011-06-14 15:03:42
Message-ID: 28546.1308063822@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Excerpts from David E. Wheeler's message of lun jun 13 17:44:05 -0400 2011:
>> I was reading the partitioning docs when I spotted this. I think it means to highlight the advantages of DROP TABLE over DELETE rather than ALTER TABLE.

> I think the point of the existing wording is to point out
> ALTER TABLE / NO INHERIT. I wonder if it's worth expanding the text to
> mention both, such as

> - <command>ALTER TABLE</> is far faster than a bulk operation.
> + <command>ALTER TABLE</> (to split out a sub-table from the partitioned
> + table) and <command>DROP TABLE</> (to remove a partition altogether) are
> + both far faster than a bulk operation.

I think you need to spell out "ALTER TABLE NO INHERIT" if you are going
to do that. This formulation seems to imply that *any* form of ALTER
TABLE is fast, which surely ain't the truth.

> However, this introductory text is supposed to be very brief; maybe we
> should remove mention of specific commands here.

No, I don't think it needs to be that brief. But if you think your
version is too long, remove the parenthetical remarks.

regards, tom lane


From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ITYM DROP TABLE
Date: 2011-06-14 16:33:27
Message-ID: 8C07B33E-E58F-4786-BC45-4699FA3599BF@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Jun 14, 2011, at 8:03 AM, Tom Lane wrote:

>> - <command>ALTER TABLE</> is far faster than a bulk operation.
>> + <command>ALTER TABLE</> (to split out a sub-table from the partitioned
>> + table) and <command>DROP TABLE</> (to remove a partition altogether) are
>> + both far faster than a bulk operation.
>
> I think you need to spell out "ALTER TABLE NO INHERIT" if you are going
> to do that. This formulation seems to imply that *any* form of ALTER
> TABLE is fast, which surely ain't the truth.
>
>> However, this introductory text is supposed to be very brief; maybe we
>> should remove mention of specific commands here.
>
> No, I don't think it needs to be that brief. But if you think your
> version is too long, remove the parenthetical remarks.

+1 I think that would be perfect.

Best,

David


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: David E(dot) Wheeler <david(at)kineticode(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ITYM DROP TABLE
Date: 2011-06-14 16:46:54
Message-ID: 1308069991-sup-9676@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Excerpts from David E. Wheeler's message of mar jun 14 12:33:27 -0400 2011:
> On Jun 14, 2011, at 8:03 AM, Tom Lane wrote:
>
> >> - <command>ALTER TABLE</> is far faster than a bulk operation.
> >> + <command>ALTER TABLE</> (to split out a sub-table from the partitioned
> >> + table) and <command>DROP TABLE</> (to remove a partition altogether) are
> >> + both far faster than a bulk operation.
> >
> > I think you need to spell out "ALTER TABLE NO INHERIT" if you are going
> > to do that. This formulation seems to imply that *any* form of ALTER
> > TABLE is fast, which surely ain't the truth.
> >
> >> However, this introductory text is supposed to be very brief; maybe we
> >> should remove mention of specific commands here.
> >
> > No, I don't think it needs to be that brief. But if you think your
> > version is too long, remove the parenthetical remarks.
>
> +1 I think that would be perfect.

Done that way (9.0 and beyond).

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ITYM DROP TABLE
Date: 2011-06-14 17:04:30
Message-ID: 1407.1308071070@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Done that way (9.0 and beyond).

Re-reading the actual commit, I notice that there's now a grammatical
problem: the following sentence says

It also entirely avoids the <command>VACUUM</command>
overhead caused by a bulk <command>DELETE</>.

which was okay when "it" referred to "ALTER TABLE", but now that there
are two commands mentioned in the previous sentence, it doesn't match.
Perhaps "These commands also avoid the ...".

regards, tom lane


From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ITYM DROP TABLE
Date: 2011-06-14 18:39:15
Message-ID: BANLkTikWHyMzDLiWJRamq-kZqjoYhzDXxQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Jun 13, 2011 at 10:44 PM, David E. Wheeler <david(at)kineticode(dot)com> wrote:
> I was reading the partitioning docs when I spotted this. I think it means to highlight the advantages of DROP TABLE over DELETE rather than ALTER TABLE.
>
> Best,
>
> David
>
> diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
> index 4c9fc5d..0cdb800 100644
> *** a/doc/src/sgml/ddl.sgml
> --- b/doc/src/sgml/ddl.sgml
> *************** VALUES ('New York', NULL, NULL, 'NY');
> *** 2332,2338 ****
>       <para>
>        Bulk loads and deletes can be accomplished by adding or removing
>        partitions, if that requirement is planned into the partitioning design.
> !       <command>ALTER TABLE</> is far faster than a bulk operation.
>        It also entirely avoids the <command>VACUUM</command>
>        overhead caused by a bulk <command>DELETE</>.
>       </para>
> --- 2332,2338 ----
>       <para>
>        Bulk loads and deletes can be accomplished by adding or removing
>        partitions, if that requirement is planned into the partitioning design.
> !       <command>DROP TABLE</> is far faster than a bulk operation.
>        It also entirely avoids the <command>VACUUM</command>
>        overhead caused by a bulk <command>DELETE</>.
>       </para>

That looks weird. I'm sure that *used* to say DROP TABLE.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: David E(dot) Wheeler <david(at)kineticode(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ITYM DROP TABLE
Date: 2011-06-14 19:14:00
Message-ID: 1308078829-sup-6259@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Excerpts from Tom Lane's message of mar jun 14 13:04:30 -0400 2011:
> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> > Done that way (9.0 and beyond).
>
> Re-reading the actual commit, I notice that there's now a grammatical
> problem: the following sentence says
>
> It also entirely avoids the <command>VACUUM</command>
> overhead caused by a bulk <command>DELETE</>.
>
> which was okay when "it" referred to "ALTER TABLE", but now that there
> are two commands mentioned in the previous sentence, it doesn't match.
> Perhaps "These commands also avoid the ...".

Yeah, fixed.

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support