On Fri, Jun 17, 2005 at 10:31:12 -0400,
Oren Mazor <oren.mazor@gmail.com> wrote:
> hm. well. I'm looking at a data set that can potentially get a few
> thousand big. So I'll stick with the COPY command.
>
> the trick is that I'm inserting a 1000 row 20 column table. This gets
> super slow, as you can imagine, so I'm looking at creating a two tables, a
> 1000 row table with a single column (my unique identifiers) and a 20
> column table with a single row (the default values) and then UNIONing them.
>
> would doing a COPY be a better idea?
If you do the inserts in one transaction this should be reasonably fast.
If a program is doing the inserts more speed can be gained by using prepare.
However, copy is a better way to go if you aren't transforming or checking
the data as it is being inserted.