From: | Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net> |
---|---|
To: | PgSQL Performance ML <pgsql-performance(at)postgresql(dot)org> |
Subject: | Re: performance of insert/delete/update |
Date: | 2002-11-23 15:06:00 |
Message-ID: | 1038063960.16125.22.camel@haggis |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers pgsql-performance |
On Fri, 2002-11-22 at 22:18, Josh Berkus wrote:
> Scott,
>
> > > > The absolutely most important thing to do to speed up inserts and
> > > > updates
> > > > is to squeeze as many as you can into one transaction.
>
> I was discussing this on IRC, and nobody could verify this assertion.
> Do you have an example of bunlding multiple writes into a transaction
> giving a performance gain?
Unfortunately, I missed the beginning of this thread, but I do
know that eliminating as many indexes as possible is the answer.
If I'm going to insert "lots" of rows in an off-line situation,
then I'll drop *all* of the indexes, load the data, then re-index.
If deleting "lots", then I'll drop all but the 1 relevant index,
then re-index afterwards.
As for bundling multiple statements into a transaction to increase
performance, I think the questions are:
- how much disk IO does one BEGIN TRANSACTION do? If it *does*
do disk IO, then "bundling" *will* be more efficient, since
less disk IO will be performed.
- are, for example, 500 COMMITs of small amounts of data more or
less efficient than 1 COMMIT of a large chunk of data? On the
proprietary database that I use at work, efficiency goes up,
then levels off at ~100 inserts per transaction.
Ron
--
+------------------------------------------------------------+
| Ron Johnson, Jr. mailto:ron(dot)l(dot)johnson(at)cox(dot)net |
| Jefferson, LA USA http://members.cox.net/ron.l.johnson |
| |
| "they love our milk and honey, but preach about another |
| way of living" |
| Merle Haggard, "The Fighting Side Of Me" |
+------------------------------------------------------------+
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2002-11-23 17:13:16 | Re: regression failures |
Previous Message | Rod Taylor | 2002-11-23 14:09:35 | Re: regression failures |
From | Date | Subject | |
---|---|---|---|
Next Message | Josh Berkus | 2002-11-23 19:25:45 | Re: performance of insert/delete/update |
Previous Message | Josh Berkus | 2002-11-23 04:18:22 | Re: performance of insert/delete/update |