Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0SKYxl32367 for ; Mon, 28 Jan 2002 15:34:59 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g0SKYxf22437; Mon, 28 Jan 2002 15:34:59 -0500 (EST) To: "Peter T. Brown" cc: pgsql-admin@postgresql.org Subject: Re: performance tuning on inserts In-reply-to: <002e01c1a839$92be6cc0$7d00000a@PETER> References: <002e01c1a839$92be6cc0$7d00000a@PETER> Comments: In-reply-to "Peter T. Brown" message dated "Mon, 28 Jan 2002 12:22:55 -0800" Date: Mon, 28 Jan 2002 15:34:59 -0500 Message-ID: <22434.1012250099@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200201/230 X-Sequence-Number: 3111 "Peter T. Brown" writes: > Regarding the SQL: The query I showed there is built dynamically from a > library of queries chosen by the application user (using a web gui). For > now, I don't have any way to intelligently condense the often complex series > of operations into a single 'smart' query. Nonetheless, I wonder whether you couldn't reconsider the structure. The fragment you showed seemed to be of two minds about whether VisitorPointer is a permanent data structure or a suitable place for temporary row insertions... > That being said, I still don't understand why doing all those inserts should > take so long since the entire table should be in memory... I am pretty sure > I've allowed enough shared_buffers. You still need WAL traffic. Or don't you care whether those inserts will survive a system crash? In-RAM buffers surely don't count as stable storage. > Regarding timestamps in pg_xlog: as I understand things, if wal_buffers and > checkpoint_segments are high enough the files in pg_xlog should never be > used, right? No, you haven't understood things at all. WAL *will* be written whenever you make changes, at the latest when the transaction is committed. regards, tom lane