Matching unique primary keys - Mailing list pgsql-general

From Kevin Old
Subject Matching unique primary keys
Date
Msg-id 1035321163.4491.139.camel@oc
Whole thread Raw
Responses Re: Matching unique primary keys
List pgsql-general
Hello all,

I have a table of data that is very large (502 columns) and whenever I
query it, I only query on up to 4 columns and on average only 20 fields
are returned.  I've come up with a way to increase the speed of the
queries.  I could could put the 20 fields that are searched and returned
into a separate table and then link them by a unique id.  Sounds
easy......but I'm stuck on something.

I am dealing with about 1 million records per day.

One option is to put a sequence on the tables, but dealing with so many
records I'd have to use a BIGINT and with a ceiling of
9223372036854775807 it seems to me that numbers this large might slow
down the query process.  I realize it would take quite a while to get to
this point, but would like other's opinions.

Another option is that I have 3 fields that when combine, make each
record unique.  Is there some way I can combine these dynamically and
then use "views" of them to reference my records and display them from
the larger table.

I realize this is very confusing, please get back with me if I should
elaborate on something.

Any help is appreciated.

Thanks,
Kevin



pgsql-general by date:

Previous
From: "Ned Lilly"
Date:
Subject: OpenMFG: PostgreSQL-backed ERP for small manufacturers
Next
From: Bruce Momjian
Date:
Subject: Contracting job in SF area