Re: estimating # of distinct values - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: estimating # of distinct values
Date
Msg-id E132F02B-FB5C-48C4-B52D-EA018D9636F4@nasby.net
Whole thread Raw
In response to Re: estimating # of distinct values  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: estimating # of distinct values  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Jan 17, 2011, at 8:11 PM, Robert Haas wrote:
> On Mon, Jan 17, 2011 at 7:56 PM, Jim Nasby <jim@nasby.net> wrote:
>> - Forks are very possibly a more efficient way to deal with TOAST than having separate tables. There's a fair amount
ofoverhead we pay for the current setup. 
>
> That seems like an interesting idea, but I actually don't see why it
> would be any more efficient, and it seems like you'd end up
> reinventing things like vacuum and free space map management.

The FSM would take some effort, but I don't think vacuum would be that hard to deal with; you'd just have to free up
thespace in any referenced toast forks at the same time that you vacuumed the heap. 

>> - Dynamic forks would make it possible to do a column-store database, or at least something approximating one.
>
> I've been wondering whether we could do something like this by
> treating a table t with columns pk, a1, a2, a3, b1, b2, b3 as two
> tables t1 and t2, one with columns pk, a1, a2, a3 and the other with
> columns pk, b1, b2, b3.  SELECT * FROM t would be translated into
> SELECT * FROM t1, t2 WHERE t1.pk = t2.pk.

Possibly, but you'd be paying tuple overhead twice, which is what I was looking to avoid with forks.
--
Jim C. Nasby, Database Architect                   jim@nasby.net
512.569.9461 (cell)                         http://jim.nasby.net




pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: limiting hint bit I/O
Next
From: Robert Haas
Date:
Subject: Re: estimating # of distinct values