table design and data type choice

Поиск
Список
Период
Сортировка
От Jayadevan M
Тема table design and data type choice
Дата
Msg-id CAFS1N4hQKcTzVZrxpDrv0KrsiqQbecvOK4GAAEks2uWCnTCOBA@mail.gmail.com
обсуждение исходный текст
Ответы Re: table design and data type choice
Список 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 по дате отправления:

Предыдущее
От: Rajeev rastogi
Дата:
Сообщение: Re: Consistent file-level backup of pg data directory
Следующее
От: Sameer Kumar
Дата:
Сообщение: Re: table design and data type choice