Re: Varchar vs foreign key vs enumerator - table and index size

Поиск
Список
Период
Сортировка
От Łukasz Walkowski
Тема Re: Varchar vs foreign key vs enumerator - table and index size
Дата
Msg-id 181A36F9-F0C5-457F-9C9C-502959359DD8@homplex.pl
обсуждение исходный текст
Ответ на Re: Varchar vs foreign key vs enumerator - table and index size  (Craig James <cjames@emolecules.com>)
Список pgsql-performance
On 1 wrz 2013, at 03:31, Craig James <cjames@emolecules.com> wrote:

> If your applications are read-heavy and only have a small-ish amount of code that inserts/updates the table, it may
notbe that much of a rewrite. You can create a integer/varchar table of key/values, use its key to replace the current
varcharcolumn, rename the original table, and create a view with the original table's name.  Code that only reads the
datawon't know the difference. And it's a portable solution. 
>
> I did this and it worked out well. If the key/value pairs table is relatively small, the planner does an excellent
jobof generating efficient queries against the big table. 
>
> Craig

Actually this (event) table is write heavy. But the concept is really cool and worth trying. Thanks.


Lukasz

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: How clustering for scale out works in PostgreSQL
Следующее
От: Łukasz Walkowski
Дата:
Сообщение: Re: Varchar vs foreign key vs enumerator - table and index size