Received: from dg.eisolution.com (dsl-209-81-146-10.dsl.iwc.net [209.81.146.10]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0R2ATl14801 for ; Sat, 26 Jan 2002 21:10:29 -0500 (EST) (envelope-from marcm@eisolution.com) Received: from marcmdelltop (12-250-85-65.client.attbi.com [12.250.85.65]) by dg.eisolution.com (8.11.6/8.11.2) with SMTP id g0R2CHd19982 for ; Sat, 26 Jan 2002 20:12:17 -0600 Message-ID: <00a001c1a6d7$c833c520$7401a8c0@Home> From: "Marc Mitchell" To: Subject: INSERT performace. Date: Sat, 26 Jan 2002 20:10:19 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 X-Archive-Number: 200201/203 X-Sequence-Number: 3088 We have a fresh database and have begun to observe performance degradation for INSERTs as a table went from empty to 100,000-ish rows. Initial INSERTs were sub second while after 30k rows, they were 1-3 seconds. Note that we have done NO performance tuning yet nor are there any indexes on the tables. My question is about the way Postgres manages the organizational structure of the base table data. From my Ingres background, I know that that product allows you to set the structure of the base data to be any of it's supported types (Hash, Heap, Btree, etc.) . And my experience tells me that this can greatly effect INSERT performance and must be properly managed. For example, you have to consider the allocation of data pages for hash and overflow and page fill factors for btrees to avoid excessive splits and balancing of index data pages. Is there anything like this in Postgres? I realize that these issues must also be considered for alternate indexes but currently, we don't have any. I'm sure eventually we will and will need to consider the overhead indexes add to INSERTs. But currently, we are basically just INSERTing into rather empty tables. Is there anything that can be done when defining a table or managing it after the fact to ensure it is ready for inserts? Aside from alternate indexes, how is the base data for a table stored and structured? While much is written about shared cache, buffer and spreading tables across disks, my thinking is that this has a much bigger impact on SELECTs (or UPDATEs) than INSERTs. So what can to done to optimize this? Also, I'm aware of fsync but don't wish to go there until I know we're not missing something simpler. Any feedback is very much appreciated.