Re: Ways to deal with large amount of columns;

Поиск
Список
Период
Сортировка
От Tim Cross
Тема Re: Ways to deal with large amount of columns;
Дата
Msg-id 87a7p3ijc3.fsf@gmail.com
обсуждение исходный текст
Ответ на Ways to deal with large amount of columns;  ("a" <372660931@qq.com>)
Ответы Re: Ways to deal with large amount of columns;  ("a" <372660931@qq.com>)
Список pgsql-general
a <372660931@qq.com> writes:

> Hi all:
>
>
> I need to make a table contains projected monthly cashflow for multiple agents (10,000 around).
>
>
> Therefore, the column number would be 1000+. 
>
>

Not sure your data model is correct. Typically, with something like
this, increasing the number of agents would result in tables with more
rows rather than more columns. Tables with large numbers of columns is
often a 'code smell' and indicates the underlying data model needs to be
reviewed. Designs which result in new columns being required because you
are adding new data sources is almost certainly an indication of the
need to review the data model.

Postgres (and many other databases) have lots of functionality to help
deal with tables that have large numbers of rows, but working with
tables that have large numbers of columns has less functionality and
options.

While it is very tempting to create a table and then start coding, you
will almost always get a much better result and simpler code if you
spend some initial time to really analyse your domain, understand the
data elements and how they relate to each other, map them out into a
data model and then start development. Have a look at
https://en.wikipedia.org/wiki/Database_normalization for some background
on the normal forms and why they are useful.

HTH

Tim



-- 
Tim Cross


В списке pgsql-general по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: searching a value in a variable/field in all tables in a schema
Следующее
От: "a"
Дата:
Сообщение: Re: Ways to deal with large amount of columns;