Skip site navigation (1) Skip section navigation (2)

Domain vs table

From: Michal Szymanski <mich20061(at)gmail(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Domain vs table
Date: 2009-10-11 14:40:53
Message-ID: 5a7361bf-e48c-4dd8-ba6c-4074184d3c55@a32g2000yqm.googlegroups.com (view raw or flat)
Thread:
Lists: pgsql-performance
Hi,
We  have table 'user' and one column define status of user, currently
there are 2 valuse 'A' acitve and 'D' deleted.
Currently we define column as domain type ( status_domain with two
possible values)
but I'm not sure is it good solution, maybe it is better create
separate table e.g account_stats and use foreign key in account table?
In our databases we prefer 'domain' solution for column with low
cardinality and when we do not need extra fields related to values
(e.g description). I think such solution should give us better
performance when rows are updated/inserted but I've never make real
comparision to separate table. Havy you made such comparision?

Regards
Michal Szymanski
http://blog.szymanskich.net
http://techblog.szymanskich.net

Responses

pgsql-performance by date

Next:From: Michal SzymanskiDate: 2009-10-11 15:31:14
Subject: Re: Domain vs table
Previous:From: Michal SzymanskiDate: 2009-10-11 14:30:33
Subject: Re: Partitioned Tables and ORDER BY

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group