Re: Large object + FREEZE?

Lists: pgsql-hackers
From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Large object + FREEZE?
Date: 2013-07-02 03:16:18
Message-ID: 20130702.121618.1902478440769241680.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Now that we have COPY FREEZE, I'm thinking about adding similar option
to creating large objects. In 9.3 the maximum size of large objects
are increased. That means, the first access to a large object will
trigger more writes because of hint bit updation. Also subsequent
VACUUM may trigger that as well. If we could freeze arge objects while
creating, it could reduce the writes dramatically as COPY FREEZE
already does.

Opinions?
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Large object + FREEZE?
Date: 2013-07-02 14:36:34
Message-ID: 20130702143634.GA5361@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Jul 2, 2013 at 12:16:18PM +0900, Tatsuo Ishii wrote:
> Now that we have COPY FREEZE, I'm thinking about adding similar option
> to creating large objects. In 9.3 the maximum size of large objects
> are increased. That means, the first access to a large object will
> trigger more writes because of hint bit updation. Also subsequent
> VACUUM may trigger that as well. If we could freeze arge objects while
> creating, it could reduce the writes dramatically as COPY FREEZE
> already does.

I was not aware that large objects had to feeze each 8k segment. Do
they?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Large object + FREEZE?
Date: 2013-07-02 15:00:51
Message-ID: CA+Tgmob6ViH=hT6Vtn2v8xuAVbWP93f8RokX270B4kC82fyA+Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Jul 1, 2013 at 11:16 PM, Tatsuo Ishii <ishii(at)postgresql(dot)org> wrote:
> Now that we have COPY FREEZE, I'm thinking about adding similar option
> to creating large objects. In 9.3 the maximum size of large objects
> are increased. That means, the first access to a large object will
> trigger more writes because of hint bit updation. Also subsequent
> VACUUM may trigger that as well. If we could freeze arge objects while
> creating, it could reduce the writes dramatically as COPY FREEZE
> already does.
>
> Opinions?

COPY FREEZE only works if the table was created in the same
transaction. Otherwise, an error midway through could leave the table
and index inconsistent. I think that's a killer for this proposal,
because obviously when a large object is created, pg_largeobject will
be pre-existing.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: robertmhaas(at)gmail(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Large object + FREEZE?
Date: 2013-07-02 16:29:40
Message-ID: 20130703.012940.1142100617623302179.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> On Mon, Jul 1, 2013 at 11:16 PM, Tatsuo Ishii <ishii(at)postgresql(dot)org> wrote:
>> Now that we have COPY FREEZE, I'm thinking about adding similar option
>> to creating large objects. In 9.3 the maximum size of large objects
>> are increased. That means, the first access to a large object will
>> trigger more writes because of hint bit updation. Also subsequent
>> VACUUM may trigger that as well. If we could freeze arge objects while
>> creating, it could reduce the writes dramatically as COPY FREEZE
>> already does.
>>
>> Opinions?
>
> COPY FREEZE only works if the table was created in the same
> transaction. Otherwise, an error midway through could leave the table
> and index inconsistent. I think that's a killer for this proposal,
> because obviously when a large object is created, pg_largeobject will
> be pre-existing.

Argh. You are right.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp