table design and data type choice - Mailing list pgsql-general

From Jayadevan M
Subject table design and data type choice
Date
Msg-id CAFS1N4hQKcTzVZrxpDrv0KrsiqQbecvOK4GAAEks2uWCnTCOBA@mail.gmail.com
Whole thread Raw
Responses Re: table design and data type choice
List pgsql-general
Hi,

We have a table to record the voteup/votedown by users of questions and answers (like on stackoverflow). So there will be a large number of inserts (voteup/down), some updates(user changes mind)and may be a few deletes. The queries will be mostly aggregates (count(*) where question_id=<x>  and vote_up =1) . Is it better to have data type of Boolean, varchar or int?

I assume there isanother decision too - have 2 columns - one for up and one for down, or have just one column which will be 1 or -1.

Regards,
Jayadevan

pgsql-general by date:

Previous
From: Rajeev rastogi
Date:
Subject: Re: Consistent file-level backup of pg data directory
Next
From: Sameer Kumar
Date:
Subject: Re: table design and data type choice