pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Florian Weimer <fweimer@bfk.de>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Large number of open(2) calls with bulk INSERT into empty table
Date: Mon, 20 Aug 2012 18:44:01 -0400
Message-ID: <11360.1345502641@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+Tgmoa=9k4DSOOtX3rx5hudCSOOBQnqFaVu2kRoO9r5djW2Jw@mail.gmail.com>
References: <82ipm51tcd.fsf@mid.bfk.de>
	<CA+TgmoYRGO5Wu4_2yzP0-cmx4GBZHqOO4WKiCxT-R3gV6qrt6A@mail.gmail.com>
	<827h29q4pd.fsf@mid.bfk.de>
	<CA+TgmobRiGQH+GNC+vTmEf=AgknBirSEUy3PFg4MzpXTXmfLqQ@mail.gmail.com>
	<20120817010524.GL30286@momjian.us>
	<CA+TgmoaJAH0_7=DO8nm2yUDZCqoSf6B=UdTz=1VZSChH667C=Q@mail.gmail.com>
	<8708.1345494466@sss.pgh.pa.us>
	<CA+Tgmoa=9k4DSOOtX3rx5hudCSOOBQnqFaVu2kRoO9r5djW2Jw@mail.gmail.com>

Robert Haas <robertmhaas@gmail.com> writes:
> On Mon, Aug 20, 2012 at 4:27 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Surely we could just prevent creation of the FSM until the table has
>> reached at least, say, 10 blocks.
>> 
>> Any threshold beyond one block would mean potential space wastage,
>> but it's hard to get excited about that until you're into the dozens
>> of pages.

> I dunno, I think one-row tables are pretty common.

Sure, and for that you don't need an FSM, because any row allocation
attempt will default to trying the last existing block before it extends
(see RelationGetBufferForTuple).  It's only once you've got more than
one block in the table that it becomes interesting.

If we had a convention that FSM is only created for rels of more than
N blocks, perhaps it'd be worthwhile to teach RelationGetBufferForTuple
to try all existing blocks when relation size <= N.  Or equivalently,
hack the FSM code to return all N pages when it has no info.

			regards, tom lane




view thread (17+ messages)  latest in thread

Message-ID: <11360.1345502641@sss.pgh.pa.us>
Permalink:  ../11360.1345502641@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11360.1345502641@sss.pgh.pa.us

 · 

reply

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-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, bruce@momjian.us, fweimer@bfk.de
  Subject: Re: Large number of open(2) calls with bulk INSERT into empty table
  In-Reply-To: <11360.1345502641@sss.pgh.pa.us>

* 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