From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Simon Riggs <simon(at)2ndquadrant(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Greg Stark <gsstark(at)mit(dot)edu>, Rod Taylor <pg(at)rbt(dot)ca>, Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: [Bizgres-general] WAL bypass for INSERT, UPDATE and |
Date: | 2006-02-04 03:29:48 |
Message-ID: | 200602040329.k143Tmw02546@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Based on this, I think we should just implement the TRUNCATE/DROP option
for the table, and avoid the idea of allowing non-logged operations on a
table that has any data we want recovered after a crash.
---------------------------------------------------------------------------
Simon Riggs wrote:
> On Thu, 2006-01-05 at 12:27 -0500, Bruce Momjian wrote:
>
> > Seems like a nice optimization.
>
> Negative thoughts: Toast tables have a toast index on them, yes? We have
> agreed that we cannot use the optimization if we have indexes on the
> main table. It follows that we cannot use the optimization if we have
> *any* toasted data, since that would require a pointer between two
> blocks, which would not be correctly recovered following a crash. If we
> log the toast table then there could be a mismatch between heap and
> toast table; if we don't log the toast table there could be a mismatch
> between toast table and toast index.
>
> We can test to see if the toast table is empty when we do ALTER TABLE,
> but loading operations may try to create toasted data rows.
>
> Presumably that means we must either:
> i) abort a COPY if we get a toastable value
> ii) if we get a toastable value, insert the row into a new block, which
> we do logging of, then also log the toast insert and the toast index
> insert - i.e. some blocks we log, others not
>
> This is still useful for many applications, IMHO, but the list of
> restrictions seems to be growing. Worse, we wouldn't know that the toast
> tables were empty until after we did the COPY TO for a pg_dump, so we
> wouldn't be able to retrospectively add an ALTER TABLE command ahead of
> the COPY.
>
> Thoughts? Hopefully there are some flaws in my thinking here,
>
> Best Regards, Simon Riggs
>
>
>
--
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
From | Date | Subject | |
---|---|---|---|
Next Message | Martijn van Oosterhout | 2006-02-04 10:59:21 | Re: [PORTS] Failed install - libgen.so doesn't exist |
Previous Message | James William Pye | 2006-02-04 01:39:38 | Copy From & Insert UNLESS |