Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 7C2CF1337B86 for ; Wed, 27 Oct 2010 16:47:36 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 63365-09 for ; Wed, 27 Oct 2010 19:47:29 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from shrek.krogh.cc (2605ds1-ynoe.0.fullrate.dk [90.184.12.24]) by mail.postgresql.org (Postfix) with ESMTP id 2550A1337B5C for ; Wed, 27 Oct 2010 16:47:28 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by shrek.krogh.cc (Postfix) with ESMTP id 586D3FEC5; Wed, 27 Oct 2010 21:47:27 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at shrek.krogh.cc Received: from shrek.krogh.cc ([127.0.0.1]) by localhost (shrek.krogh.cc [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pSGKWArgrp5B; Wed, 27 Oct 2010 21:47:24 +0200 (CEST) Received: from [90.184.13.151] (2605ds1-ynoe.2.fullrate.dk [90.184.13.151]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jesper@krogh.cc) by shrek.krogh.cc (Postfix) with ESMTPSA id E2D57FE90; Wed, 27 Oct 2010 21:47:23 +0200 (CEST) Message-ID: <4CC881CB.8090806@krogh.cc> Date: Wed, 27 Oct 2010 21:47:23 +0200 From: Jesper Krogh User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100915 Thunderbird/3.0.8 MIME-Version: 1.0 To: Merlin Moncure CC: Divakar Singh , Robert Haas , Mladen Gogala , pgsql-performance@postgresql.org Subject: Re: Postgres insert performance and storage requirement compared to Oracle References: <402913.53404.qm@web65405.mail.ac4.yahoo.com> <208728.42197.qm@web65409.mail.ac4.yahoo.com> <770715.39613.qm@web29003.mail.ird.yahoo.com> <4CC741FF.8050709@vmsinfo.com> <4CC74E31.6060307@vmsinfo.com> <252538.42200.qm@web65405.mail.ac4.yahoo.com> <173298.80592.qm@web65406.mail.ac4.yahoo.com> <4CC8728B.9050205@krogh.cc> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201010/506 X-Sequence-Number: 40924 On 2010-10-27 20:51, Merlin Moncure wrote: >> Yes, I am quite aware of how the o/s page cache works. All else being >> equal, I more compact database obviously would be preferred. However >> 'all else' is not necessarily equal. I can mount my database on bzip >> volume, that must make it faster, right? wrong. I understand the >> postgres storage architecture pretty well, and the low hanging fruit >> having been grabbed further layout compression is only going to come >> as a result of tradeoffs. >> Or configureabillity.. Not directly related to overall space consumption but I have been working on a patch that would make TOAST* kick in earlier in the process, giving a "slimmer" main table with visibillity information and simple columns and moving larger colums more aggressively to TOAST. The overall disadvantage of TOAST is the need for an extra disk seek if you actually need the data. If the application rarely needs the large columns but often do count/filtering on simple values this will eventually lead to a better utillization of the OS-page-cache with a very small overhead to PG (in terms of code) and 0 overhead in the applications that benefit. Keeping in mind that as SSD-drives get more common the "the extra disk seek" drops dramatically, but the drive is by itself probably still 100-1000x slower than main memory, so keeping "the right data" in the OS-cache is also a parameter. If you deal with data where the individual tuple-size goes up, currently TOAST first kicks in at 2KB (compressed size) which leads to a very sparse main table in terms of visibillity information and count and selects on simple values will drag a huge amount of data into the cache-layers thats not needed there. Another suggestion could be to make the compression of text columns kick in earlier .. if thats possible. (I dont claim that its achiveable) Unless the tuple-header is hugely bloated I have problems creating a situation in my head where hammering that one can change anything significantly. * http://www.mail-archive.com/pgsql-hackers@postgresql.org/msg159726.html -- Jesper