Re: how to add more than 1600 columns in a table?

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: pabloa98 <pabloa98(at)gmail(dot)com>
Cc: Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>, Joe Conway <mail(at)joeconway(dot)com>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: how to add more than 1600 columns in a table?
Date: 2019-04-24 22:55:19
Message-ID: 20190424225519.GA8439@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2019-Apr-24, pabloa98 wrote:

> Regarding to (2), We are good by adding a patch and recompile a patched
> version for our server databases.
>
> But we are open on helping to add thousands of columns support as a
> compile-time parameter if there are other people interested.

It's hard to say what you're doing wrong when we don't know
what are you actually doing.

I think raising the limit requires changing ItemIdData, t_hoff, and a
few members of PageHeaderData at the very least. Reading the three
header files involved carefully would probably point out areas I've
forgotten to mention. I think if you enlarge t_hoff and lp_off/lp_len
to 16 bits, you can use 64kB blocks, which might be useful too.

Note that with pg12 you could have your own table AM that supported
wider ItemIds as a (small?) change on heapam, rather than supplant it
for all tables. That way you would only pay the (probably considerable)
cost of the wider line pointers on all tables ...

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2019-04-24 23:01:15 Re: how to add more than 1600 columns in a table?
Previous Message pabloa98 2019-04-24 22:38:19 Re: how to add more than 1600 columns in a table?