store A LOT of 3-tuples for comparisons - Mailing list pgsql-performance

From Moritz Onken
Subject store A LOT of 3-tuples for comparisons
Date
Msg-id D35BC72A-6E10-43C8-A376-BBFD78BE7E4B@houseofdesign.de
Whole thread Raw
Responses Re: store A LOT of 3-tuples for comparisons
List 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 by date:

Previous
From: Guillaume Cottenceau
Date:
Subject: Re: 7 hrs for a pg_restore?
Next
From: Matthew
Date:
Subject: Re: store A LOT of 3-tuples for comparisons