Re: Altering a column type - Most efficient way

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Ow Mun Heng <Ow(dot)Mun(dot)Heng(at)wdc(dot)com>
Cc: Mario Weilguni <mweilguni(at)sime(dot)com>, Pgsql performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Altering a column type - Most efficient way
Date: 2008-07-11 13:44:23
Message-ID: 20080711134423.GA4110@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Scott Marlowe 2008-07-11 14:19:50 Re: 3ware vs Areca
Previous Message Jeff 2008-07-11 13:26:37 3ware vs Areca