Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 16D7B63297B for ; Thu, 7 Jan 2010 11:45:30 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 69011-04 for ; Thu, 7 Jan 2010 15:45:09 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mta.4linux.com.br (boca.4linux.com.br [200.212.122.137]) by mail.postgresql.org (Postfix) with ESMTP id 2A7226323EB for ; Thu, 7 Jan 2010 11:45:19 -0400 (AST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mta.4linux.com.br (Postfix) with ESMTP id 56D6FC67E; Thu, 7 Jan 2010 12:45:16 -0300 (BRT) X-Virus-Scanned: amavisd-new at mta.4linux.com.br Received: from mta.4linux.com.br ([127.0.0.1]) by localhost (mta.4linux.com.br [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kOpyEpMnJA17; Thu, 7 Jan 2010 12:45:16 -0300 (BRT) Received: from mail.4linux.com.br (unknown [192.168.0.11]) by mta.4linux.com.br (Postfix) with ESMTP id 0CD27C473; Thu, 7 Jan 2010 12:45:16 -0300 (BRT) Date: Thu, 7 Jan 2010 13:45:16 -0200 (BRST) From: "Gurgel, Flavio" To: Lefteris Cc: pgsql-performance@postgresql.org, Ivan Voras Message-ID: <32176465.41521262879116337.JavaMail.root@mail.4linux.com.br> In-Reply-To: <3633428.41261262878597024.JavaMail.root@mail.4linux.com.br> Subject: Re: Air-traffic benchmark MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.0.185] X-Mailer: Zimbra 6.0.0_GA_1802.UBUNTU6 (ZimbraWebClient - FF3.0 (Linux)/6.0.0_GA_1802.UBUNTU6) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.67 tagged_above=-10 required=5 tests=AWL=-0.930, BAYES_20=-0.74 X-Spam-Level: X-Archive-Number: 201001/99 X-Sequence-Number: 36979 ----- "Lefteris" escreveu: > > Did you ever try increasing shared_buffers to what was suggested > (around > > 4 GB) and see what happens (I didn't see it in your posts)? > > No I did not to that yet, mainly because I need the admin of the > machine to change the shmmax of the kernel and also because I have no > multiple queries running. Does Seq scan uses shared_buffers? Having multiple queries running is *not* the only reason you need lots of shared_buffers. Think of shared_buffers as a page cache, data in PostgreSQL is organized in pages. If one single query execution had a step that brought a page to the buffercache, it's enough to increase another step speed and change the execution plan, since the data access in memory is (usually) faster then disk. > > help performance very much on multiple exequtions of the same > query. This is also true. This kind of test should, and will, give different results in subsequent executions. > > From the description of the data ("...from years 1988 to 2009...") > it > > looks like the query for "between 2000 and 2009" pulls out about > half of > > the data. If an index could be used instead of seqscan, it could be > > perhaps only 50% faster, which is still not very comparable to > others. The use of the index over seqscan has to be tested. I don't agree in 50% gain, since simple integers stored on B-Tree have a huge possibility of beeing retrieved in the required order, and the discarded data will be discarder quickly too, so the gain has to be measured. I bet that an index scan will be a lot faster, but it's just a bet :) > > The table is very wide, which is probably why the tested databases > can > > deal with it faster than PG. You could try and narrow the table > down > > (for instance: remove the Div* fields) to make the data more > > "relational-like". In real life, speedups in this circumstances > would > > probably be gained by normalizing the data to make the basic table > > smaller and easier to use with indexing. Ugh. I don't think so. That's why indexes were invented. PostgreSQL is smart enough to "jump" over columns using byte offsets. A better option for this table is to partition it in year (or year/month) chunks. 45GB is not a so huge table compared to other ones I have seen before. I have systems where each partition is like 10 or 20GB and data is very fast to access even whith aggregation queries. Flavio Henrique A. Gurgel tel. 55-11-2125.4765 fax. 55-11-2125.4777 www.4linux.com.br FREE SOFTWARE SOLUTIONS