Using ENUM with huge NAMEDATALEN - Mailing list pgsql-performance

From David Andersen
Subject Using ENUM with huge NAMEDATALEN
Date
Msg-id c6bf5b380807261422i77ed5b3evf55da6891e2e4170@mail.gmail.com
Whole thread Raw
Responses Re: Using ENUM with huge NAMEDATALEN  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-performance by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Partitioned Tables Foreign Key Constraints Problem
Next
From: Tom Lane
Date:
Subject: Re: Using ENUM with huge NAMEDATALEN