Using ENUM with huge NAMEDATALEN

From: "David Andersen" <david(at)andersen(dot)gs>
To: pgsql-performance(at)postgresql(dot)org
Subject: Using ENUM with huge NAMEDATALEN
Date: 2008-07-26 21:22:09
Message-ID: c6bf5b380807261422i77ed5b3evf55da6891e2e4170@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi All,

This is my first post so please be gentle if I make any mistakes.

I know that ENUMs were not intended to be used instead of joins, but I
believe that I my case there will be huge saves on using Enums. Every night
I will drop the database and rebuild it from CSV files. The database will be
quite large with around 200 million rows in a fact table (only numbers).
There are about 10 dimension tables (lookup table with ID and text columns).
What is very special is that the software I am 100% dependent on to generate
queries, joins the fact table will all dimension tables in all cases. Mostly
my queries do not include any WHERE clauses (apart from those needed for
joins) only GROUP BY and HAVING. Joining 200 million rows with side tables
that on average have about 50000 rows, is heavy. When I need results within
10 seconds, I believe there is a need for Enums.

One of the side tables is text with length of up to 900 characters. My
question is whether I could build PostgreSQL with NAMEDATALEN (which
controls the max size of Enums) equal to 900? Or do you see any things going
wrong then (like stability problems or whatever)?

Regards,

David

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2008-07-26 21:44:24 Re: Using ENUM with huge NAMEDATALEN
Previous Message Josh Berkus 2008-07-25 22:31:55 Re: Partitioned Tables Foreign Key Constraints Problem