store A LOT of 3-tuples for comparisons

From: Moritz Onken <onken(at)houseofdesign(dot)de>
To: pgsql-performance(at)postgresql(dot)org
Subject: store A LOT of 3-tuples for comparisons
Date: 2008-02-22 15:42:29
Message-ID: D35BC72A-6E10-43C8-A376-BBFD78BE7E4B@houseofdesign.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Matthew 2008-02-22 15:49:34 Re: store A LOT of 3-tuples for comparisons
Previous Message Guillaume Cottenceau 2008-02-22 10:40:42 Re: 7 hrs for a pg_restore?