From:
Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To:
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc:
Greg Stark <gsstark(at)mit(dot)edu>, Neil Conway <neilc(at)samurai(dot)com>,Alvaro Herrera <alvherre(at)surnet(dot)cl>,Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject:
Re: NOLOGGING option, or ?
Date:
2005-06-01 22:05:13
Message-ID:
200506012205.j51M5DF03365@candle.pha.pa.us (view raw or flat )
Thread:
2005-05-31 23:01:43 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2005-06-01 02:47:30 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-06-01 04:40:07 from Alvaro Herrera <alvherre(at)surnet(dot)cl>
2005-06-01 05:00:04 from Neil Conway <neilc(at)samurai(dot)com>
2005-06-01 08:21:39 from Greg Stark <gsstark(at)mit(dot)edu>
2005-06-01 08:44:24 from Greg Stark <gsstark(at)mit(dot)edu>
2005-06-01 12:03:25 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2005-06-01 13:39:07 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2005-06-01 13:58:53 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-06-01 14:12:18 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2005-06-01 14:18:25 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-06-01 15:21:07 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2005-06-01 15:55:46 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-06-01 17:55:46 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2005-06-01 18:10:45 from Alvaro Herrera <alvherre(at)surnet(dot)cl>
2005-06-01 18:24:39 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-06-01 20:17:39 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2005-06-01 18:14:27 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-06-01 20:33:24 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2005-06-01 22:05:13 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2005-06-01 22:32:32 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-06-01 22:47:17 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2005-06-01 23:02:17 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2005-06-01 22:37:51 from Hannu Krosing <hannu(at)tm(dot)ee>
2005-06-01 14:07:37 from Jochem van Dieten <jochemd(at)gmail(dot)com>
2005-06-01 14:14:42 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2005-06-01 15:43:24 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-06-01 16:00:28 from Jochem van Dieten <jochemd(at)gmail(dot)com>
2005-06-01 21:27:01 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2005-06-01 08:16:46 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2005-06-01 08:34:38 from Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
2005-06-01 11:54:19 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2005-06-01 14:01:06 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-06-01 09:54:58 from Hannu Krosing <hannu(at)skype(dot)net>
2005-06-01 17:35:30 from "Alon Goldshuv" <agoldshuv(at)greenplum(dot)com>
2005-06-01 21:56:07 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2005-06-01 22:18:41 from "Luke Lonergan" <llonergan(at)greenplum(dot)com>
2005-06-01 22:37:07 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-06-02 00:05:29 from "Luke Lonergan" <llonergan(at)greenplum(dot)com>
2005-06-02 01:05:11 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2005-06-02 01:54:51 from "Luke Lonergan" <llonergan(at)greenplum(dot)com>
2005-06-02 02:27:51 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2005-06-02 02:40:06 from "Luke Lonergan" <llonergan(at)greenplum(dot)com>
2005-06-01 23:00:34 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2005-06-01 23:29:30 from "Alon Goldshuv" <agoldshuv(at)greenplum(dot)com>
2005-06-02 01:01:56 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2005-06-02 01:50:23 from "Luke Lonergan" <llonergan(at)greenplum(dot)com>
2005-06-02 02:13:38 from Oliver Jowett <oliver(at)opencloud(dot)com>
2005-06-02 02:28:41 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2005-06-02 02:35:33 from "Luke Lonergan" <llonergan(at)greenplum(dot)com>
2005-06-02 02:47:26 from Steve Atkins <steve(at)blighty(dot)com>
2005-06-02 03:35:57 from "Luke Lonergan" <llonergan(at)greenplum(dot)com>
2005-06-02 05:16:34 from "Luke Lonergan" <llonergan(at)greenplum(dot)com>
2005-06-01 22:39:59 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2005-06-01 23:06:07 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2005-06-01 23:06:09 from Joe Conway <mail(at)joeconway(dot)com>
2005-06-02 03:41:29 from Alvaro Herrera <alvherre(at)surnet(dot)cl>
2005-06-02 16:54:56 from "Alon Goldshuv" <agoldshuv(at)greenplum(dot)com>
2005-06-01 06:25:42 from Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>
2005-06-01 14:43:44 from Dawid Kuroczko <qnex42(at)gmail(dot)com>
2005-06-01 12:10:55 from Hannu Krosing <hannu(at)skype(dot)net>
2005-06-01 15:31:31 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-06-01 16:18:09 from Hannu Krosing <hannu(at)tm(dot)ee>
2005-06-01 17:00:28 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2005-06-01 17:18:55 from Alvaro Herrera <alvherre(at)surnet(dot)cl>
2005-06-01 17:35:25 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Lists:
pgsql-hackers
Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Tom Lane wrote:
> >> Not unless you are proposing to change COPY to acquire a lock strong
> >> enough to lock out other writers to the table for the duration ...
>
> > Well, if the table is initally empty, what harm is there in locking the
> > table?
>
> You cannot *know* whether it is empty unless you lock the table before
> you look. So your argument is circular.
>
> I think this only makes sense as an explicit option to COPY, one of the
> effects of which would be to take a stronger lock than COPY normally does.
One idea would be to look at the table file size first. If it has zero
blocks, lock the table and if it still has zero blocks, do the no-WAL
copy.
I hate to add a flag to a command when we can automatically handle it
ourselves.
Now, you mentioned the idea of doing the optimization in tables that
already have data, and if we do that, we would need a flag because the
lock is stronger than what we have now.
What we could do is to do no-WAL automatically for empty tables (like
when a database is first loaded), and use the flag for cases where the
tables is not zero pages. The fact is that database loads are a prefect
case for this optimization and old dumps are not going to have that flag
anyway, and automatic is better if we can do it.
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
In response to
Responses
pgsql-hackers by date
Next :From: Meredith L. PattersonDate: 2005-06-01 22:08:12
Subject : Re: Google's Summer of Code ...
Previous :From : Bruce MomjianDate : 2005-06-01 21:56:07
Subject : Re: NOLOGGING option, or ?