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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1 wrz 2013, at 03:31, Craig James <cjames@xxxxxxxxxxxxxx> wrote:

> If your applications are read-heavy and only have a small-ish amount of code that inserts/updates the table, it may not be that much of a rewrite. You can create a integer/varchar table of key/values, use its key to replace the current varchar column, rename the original table, and create a view with the original table's name.  Code that only reads the data won'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 job of 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

-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance





[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux