Re: Fast ALTER TABLE ... ADD COLUMN ... DEFAULT xxx? - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Fast ALTER TABLE ... ADD COLUMN ... DEFAULT xxx?
Date
Msg-id 200905211250.57328.peter_e@gmx.net
Whole thread Raw
In response to Fast ALTER TABLE ... ADD COLUMN ... DEFAULT xxx?  (Dmitry Koterov <dmitry@koterov.ru>)
List pgsql-hackers
On Thursday 21 May 2009 11:06:29 Dmitry Koterov wrote:
> 1. Store the DEFAULT flag directly in NULL BITMAP (add a bit to NULL bitmap
> not only for NULLable fields, but also for NOT NULL DEFAULT ... fields).
> 2. Add another bitmap for each tuple (DEFAULT bitmap). Bit value 0 means
> that there is a real value in a cell, 1 - that the value is default.
> 3. The same as (1), but always force default value to be 0 (or false or any
> other values with meaning "zero") and optimize only these cases.

It seems to me that these solutions would require everyone in the world to pay 
the overhead of a few to many bits in every tuple to optimize what appears to 
be a relatively rare circumstance after all.  Doesn't seem worth it to me.


pgsql-hackers by date:

Previous
From: Dmitry Koterov
Date:
Subject: Fast ALTER TABLE ... ADD COLUMN ... DEFAULT xxx?
Next
From: Peter Eisentraut
Date:
Subject: Re: Compiler warning