Re: optimal insert - Mailing list pgsql-sql

From Bruno Wolff III
Subject Re: optimal insert
Date
Msg-id 20061009040924.GA20636@wolff.to
Whole thread Raw
In response to optimal insert  ("Dirk Jagdmann" <jagdmann@gmail.com>)
List pgsql-sql
On Sun, Oct 08, 2006 at 23:04:02 +0200, Dirk Jagdmann <jagdmann@gmail.com> wrote:
> 
> insert into a_b(a,b) values(1,100);
> insert into a_b(a,b) values(1,200);
> insert into a_b(a,b) values(1,54);
> insert into a_b(a,b) values(1,4577);
> 
> So for a batch of inserts the value of a stays the same, while for by
> arbitrary values are inserted. Now I have wondered if PostreSQL offers
> a smarter way to insert those values? A solution can contains usage of
> some plpgsql code.

I don't think you are going to be able to save anything by 'a' being fixed
unless there is a way to compute 'b', so that you can use a select statement.

Just do the normal stuff you would when speeding up inserts. The biggest
probably being wrapping them all up in one transaction.


pgsql-sql by date:

Previous
From: "Dirk Jagdmann"
Date:
Subject: optimal insert
Next
From: Kyle Bateman
Date:
Subject: Re: PG 8.2beta reordering working for this case?