[prev in list] [next in list] [prev in thread] [next in thread]
List: postgresql-sql
Subject: Re: [SQL] Column limits in table/ views
From: Tom Lane <tgl () sss ! pgh ! pa ! us>
Date: 2003-06-09 14:22:23
[Download RAW message or body]
Rod Taylor <rbt@rbt.ca> writes:
> On Fri, 2003-06-06 at 18:02, A.M. wrote:
>> I have 560 columns of NUMERIC(10,14). To not run up against max column
>> restraints, I split the information into two tables. Does the column
>> limit on tables imply the same limit for views or selects or could I
>> potentially select a row across both tables and make a view that hides
>> the split?
> The limit is documented as having to do with the size of a block. The
> largest a single row can become is 8k with primitive types (text, and
> other variable length types will 'overflow' into another area -- see
> TOAST).
> Selects should be able to return more columns than that. Both views and
> tables create a ROW TYPE to represent it, which is where the limitation
> is. Thus, I would not expect you to be able to create a view.
But a view row is never stored on disk, so the block-size limit doesn't
come into play. You will still be constrained by the max column count
(1600), because that comes from the tuple header layout --- the size of
the header plus null bitmap has to fit into a uint8 field. But a view
with 560 columns would work.
I think some performance issues might come up if you actually try to
select all the columns at once, because there are places whose behavior
is O(N^2) in the number of columns. Dunno whether this effect will be
noticeable with ~560 columns though.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic