ITYM DROP TABLE
ITYM DROP TABLE
От:
"David E. Wheeler" <david@kineticode.com>
Дата:
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 **** Bulk loads and deletes can be accomplished by adding or removing partitions, if that requirement is planned into the partitioning design.
! ALTER TABLE</> is far faster than a bulk operation. It also entirely avoids the VACUUM overhead caused by a bulk DELETE</>.
--- 2332,2338 ---- Bulk loads and deletes can be accomplished by adding or removing partitions, if that requirement is planned into the partitioning design.
! DROP TABLE</> is far faster than a bulk operation. It also entirely avoids the VACUUM overhead caused by a bulk DELETE</>.
Re: ITYM DROP TABLE
От:
Robert Haas <robertmhaas@gmail.com>
Дата:
On Mon, Jun 13, 2011 at 5:44 PM, David E. Wheeler 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
Re: ITYM DROP TABLE
От:
Alvaro Herrera <alvherre@commandprompt.com>
Дата:
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'); Bulk loads and deletes can be accomplished by adding or removing partitions, if that requirement is planned into the partitioning design.
- ALTER TABLE</> is far faster than a bulk operation.
+ ALTER TABLE</> (to split out a sub-table from the partitioned
+ table) and DROP TABLE</> (to remove a partition altogether) are
+ both far faster than a bulk operation. It also entirely avoids the VACUUM overhead caused by a bulk DELETE</>.
However, this introductory text is supposed to be very brief; maybe we
should remove mention of specific commands here.
--
Álvaro Herrera
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Re: ITYM DROP TABLE
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Alvaro Herrera 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 > - ALTER TABLE</> is far faster than a bulk operation. > + ALTER TABLE</> (to split out a sub-table from the partitioned > + table) and 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
Re: ITYM DROP TABLE
От:
"David E. Wheeler" <david@kineticode.com>
Дата:
On Jun 14, 2011, at 8:03 AM, Tom Lane wrote: >> - ALTER TABLE</> is far faster than a bulk operation. >> + ALTER TABLE</> (to split out a sub-table from the partitioned >> + table) and 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
Re: ITYM DROP TABLE
От:
Alvaro Herrera <alvherre@commandprompt.com>
Дата:
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: > > >> - ALTER TABLE</> is far faster than a bulk operation. > >> + ALTER TABLE</> (to split out a sub-table from the partitioned > >> + table) and 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 The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Re: ITYM DROP TABLE
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Alvaro Herrera 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 VACUUM overhead caused by a bulk 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
Re: ITYM DROP TABLE
От:
Simon Riggs <simon@2ndQuadrant.com>
Дата:
On Mon, Jun 13, 2011 at 10:44 PM, David E. Wheeler 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 ****
>
> Bulk loads and deletes can be accomplished by adding or removing
> partitions, if that requirement is planned into the partitioning design.
> ! ALTER TABLE</> is far faster than a bulk operation.
> It also entirely avoids the VACUUM
> overhead caused by a bulk DELETE</>.
>
> --- 2332,2338 ----
>
> Bulk loads and deletes can be accomplished by adding or removing
> partitions, if that requirement is planned into the partitioning design.
> ! DROP TABLE</> is far faster than a bulk operation.
> It also entirely avoids the VACUUM
> overhead caused by a bulk DELETE</>.
>
That looks weird. I'm sure that *used* to say DROP TABLE.
--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
Re: ITYM DROP TABLE
От:
Alvaro Herrera <alvherre@commandprompt.com>
Дата:
Excerpts from Tom Lane's message of mar jun 14 13:04:30 -0400 2011: > Alvaro Herrera 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 VACUUM > overhead caused by a bulk 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 The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support