store A LOT of 3-tuples for comparisons

Поиск
Список
Период
Сортировка
От Moritz Onken
Тема store A LOT of 3-tuples for comparisons
Дата
Msg-id D35BC72A-6E10-43C8-A376-BBFD78BE7E4B@houseofdesign.de
обсуждение исходный текст
Ответы Re: store A LOT of 3-tuples for comparisons  (Matthew <matthew@flymine.org>)
Список pgsql-performance
Hi,

I need to store a lot of 3-tuples of words (e.g. "he", "can",
"drink"), order matters!
The source is about 4 GB of these 3-tuples.
I need to store them in a table and check whether one of them is
already stored, and if that's the case to increment a column named
"count" (or something).

I thought of doing all the inserts without having an index and without
doing the check whether the row is already there. After that I'd do a
"group by" and count(*) on that table. Is this a good idea?

I don't know much about Pgs data types. I'd try to use the varchar
type. But maybe there is a better data type?
What kind of index should I use?

This is for a scientific research.

Thanks in advance

moritz


В списке pgsql-performance по дате отправления:

Предыдущее
От: Guillaume Cottenceau
Дата:
Сообщение: Re: 7 hrs for a pg_restore?
Следующее
От: Matthew
Дата:
Сообщение: Re: store A LOT of 3-tuples for comparisons