Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id EB56E1337B63 for ; Mon, 4 Oct 2010 01:02:26 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 93174-06 for ; Mon, 4 Oct 2010 04:02:15 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by mail.postgresql.org (Postfix) with ESMTP id CE6701337B39 for ; Mon, 4 Oct 2010 01:02:14 -0300 (ADT) Received: from [192.168.1.6] (static-71-179-240-8.bltmmd.fios.verizon.net [71.179.240.8]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0LcC9p-1OLcP20qij-00k94n; Mon, 04 Oct 2010 06:02:13 +0200 Message-ID: <4CA951C3.40808@2ndquadrant.com> Date: Mon, 04 Oct 2010 00:02:11 -0400 From: Greg Smith User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: =?ISO-8859-1?Q?Fabr=EDcio_dos_Anjos_Silva?= CC: pgsql-performance@postgresql.org Subject: Re: How does PG know if data is in memory? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:797WjyriRDJs+NYGLdUSH5GhJgd4BOmpBGLN18ZiLEx oef5MEbnYNe/vSBAHXqZi7YKIgglwBZIzld1iBqqlR2pqP7uN2 zQrU7EQhemQObodx5vHsn9EeUapaqkeAYcnJkbX9WzaEfuLqlJ gZ259gk02JtBlItpOa86HU/dVEZllI6D3JqvoPbcXvFNWg1YOm rR9th9fX995NfEp1gpuuTMSliAOwg5gHsl3pONXby0= 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, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201010/23 X-Sequence-Number: 40442 Fabrício dos Anjos Silva wrote: > If someone could point good books about PG tuning, I would appreciate > that. I found some yet to be released books about PG 9. Any comments > about them? The largest treatment of the subject already in print I'm aware of is in the Korry and Susan Douglas "PostgreSQL" book from 2005, which has around 30 pages convering PostgreSQL 8.0. That material is very good and much of it still applies, but it's mostly theory without many examples, and there have been a lot of changes to the optimizer since then. There's a good talk by Robert Haas on this subject too that's quite current, you can find his slides at http://sites.google.com/site/robertmhaas/presentations and a recording of one version of him giving it is at http://www.pgcon.org/2010/schedule/events/208.en.html My "PostgreSQL 9.0 High Performance", due out later this month if things continue on schedule, has about 80 pages dedicated to indexing and query optimization (waiting for final typesetting to know the exact count). The main difference with what I do compared to every other treatment I've seen of this subject is I suggest a sample small but not trivial data set, then show plans for real queries run against it. So you should be able to duplicate the examples, and then tinker with them on your own system to see their plans change as you adjust parameters to follow along. That really is the only way to gain expertise here. Starting with the troublesome queries from your live system will work just as well for that, once you get familiar with enough of the basics. I'd suggest taking a look and listen to Robert's talk for now, that will get you started in the right direction, and combine it with reading all of the documentation in the manual on this subject. That should keep you busy for a while, and by the time you're done you may find my book is available too. -- Greg Smith, 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services and Support www.2ndQuadrant.us Author, "PostgreSQL 9.0 High Performance" Pre-ordering at: https://www.packtpub.com/postgresql-9-0-high-performance/book