From: Alvaro Herrera <alvherre@commandprompt.com>
To: Ow Mun Heng <Ow.Mun.Heng@wdc.com>
Cc: Mario Weilguni <mweilguni@sime.com>
Cc: Pgsql performance <pgsql-performance@postgresql.org>
Subject: Re: Altering a column type - Most efficient way
Date: Fri, 11 Jul 2008 09:44:23 -0400
Message-ID: <20080711134423.GA4110@alvh.no-ip.org> (raw)
In-Reply-To: <1215742620.853.10.camel@neuromancer.home.net>
References: <1215676380.15319.2.camel@neuromancer.home.net>
<4875C9FA.7020101@sime.com>
<1215682481.15319.14.camel@neuromancer.home.net>
<20080710135756.GD3757@alvh.no-ip.org>
<1215742620.853.10.camel@neuromancer.home.net>
Ow Mun Heng wrote:
> If it were this simple a change, I'm not certain why (I believe) PG is
> checking each and every row to see if it will fit into the new column
> definition/type.
Because the code that does the ALTER TYPE is very generic, and it
doesn't (yet) have an optimization that tells it to skip the check and
the possible table rewrite in the cases where it's obviously not needed
(like this one).
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: alvherre@commandprompt.com, Ow.Mun.Heng@wdc.com, mweilguni@sime.com
Subject: Re: Altering a column type - Most efficient way
In-Reply-To: <20080711134423.GA4110@alvh.no-ip.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox