Skip site navigation (1) Skip section navigation (2)

Re: More then 1600 columns?

From: Peter Bex <Peter(dot)Bex(at)xs4all(dot)nl>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: More then 1600 columns?
Date: 2010-11-12 07:36:56
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
On Fri, Nov 12, 2010 at 10:17:50AM +0300, Dmitriy Igrishin wrote:
> Hey Mark,
> Yeah, I can't imagine an entity in a real project even with more than 100
> columns. Its rare case.
> But if you entities (rows/tuples) of some class (table) can contains
> variable
> set of columns (properties) you can look at hstore contrib module.

What can also work extremely well is storing the data in an array.
If you need to access the array based on more meaningful keys you could
store key/index pairs in another table.

This approach only works well if you have multiple arrays with the same
layout.  You probably also need to build up your query dynamically if
you need to access variable numbers of datapoints.

"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
							-- Donald Knuth

In response to


pgsql-general by date

Next:From: Dmitriy IgrishinDate: 2010-11-12 07:43:14
Subject: Re: More then 1600 columns?
Previous:From: mbwlDate: 2010-11-12 07:27:05
Subject: Re: Instructions/status of modpglogger

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group