From: Bruno Wolff III <bruno@wolff.to>
To: Dirk Jagdmann <jagdmann@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: optimal insert
Date: Sun, 8 Oct 2006 23:09:24 -0500
Message-ID: <20061009040924.GA20636@wolff.to> (raw)
In-Reply-To: <5d0f60990610081404s79a90cdbha4603c70c75ce233@mail.gmail.com>
References: <5d0f60990610081404s79a90cdbha4603c70c75ce233@mail.gmail.com>
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.
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: bruno@wolff.to, jagdmann@gmail.com
Subject: Re: optimal insert
In-Reply-To: <20061009040924.GA20636@wolff.to>
* 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