From: Tom Lane <tgl@sss.pgh.pa.us>
To: phillips@weatherbeeta.com.au
Cc: 'Aaron Bono' <aaron.bono@aranya.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: COPY to table with array columns (Longish)
Date: Mon, 12 Jun 2006 20:30:14 -0400
Message-ID: <14241.1150158614@sss.pgh.pa.us> (raw)
In-Reply-To: <003901c68e7a$4833dab0$9b0014ac@ITPhil>
References: <003901c68e7a$4833dab0$9b0014ac@ITPhil>
"Phillip Smith" <phillips@weatherbeeta.com.au> writes:
> The whole sys file is variable length records like this - they range =
> from 1
> to over 17,000 fields per record.
17000? I think you really need to rethink your schema. While you could
theoretically drop 17000 elements into a PG array column, you wouldn't
like the performance --- it'd be almost unsearchable for instance.
I'd think about two tables, one with a single row for each SYS record
from the original, and one with one row for each detail item (the
invoice numbers in this case). With suitable indexes and a foreign key
constraint, this will perform a lot better than an array-based
translation.
And no, in neither case will you be able to import that file without
massaging it first.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, phillips@weatherbeeta.com.au, aaron.bono@aranya.com
Subject: Re: COPY to table with array columns (Longish)
In-Reply-To: <14241.1150158614@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox