Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 6BB88B5DC25 for ; Thu, 27 Oct 2011 18:25:48 -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 28561-02 for ; Thu, 27 Oct 2011 21:25:42 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from smtp.peak6.com (smtp.peak6.com [38.98.137.6]) by mail.postgresql.org (Postfix) with ESMTP id D7F5FB5DC24 for ; Thu, 27 Oct 2011 18:25:41 -0300 (ADT) X-AuditID: 0a64cb1e-b7c21ae0000074d4-fa-4ea9bf80c9c4 Message-ID: <4EA9BF84.3000203@peak6.com> Date: Thu, 27 Oct 2011 15:31:00 -0500 From: Shaun Thomas Reply-To: Organization: Peak6 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Robert Haas CC: Giovanni Mancuso , Subject: Re: Performance problem with a table with 38928077 record References: <4E8ECEB7.4080800@babel.it> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed content-transfer-encoding: 7bit X-Originating-IP: [10.10.220.61] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLIsWRmVeSWpSXmKPExsXCxcQrptuwf6Wfwc/9UhZrvldYXJ95jtni 5bl+Jgdmj0O37jB77Jx1l93jwr5p7AHMUQ2MNol5efkliSWpCimpxcm2SgGujt5mCsEliXkp iUUpCi6Zxck5iZm5qUVKCpkptkpGSgoFOYnJqbmpeSW2SokFBal5KUp2XAoYwAaoLDNPITUv OT8lMy/dVskz2F/XwsLUUtdQyS4eARK6WTLuNPWzFrxjrmifuouxgbGZuYuRk0NCwETi9qtF TBC2mMSFe+vZQGxeAQ2J33d72EFsFgFViYmbD7KA2GwCahILd99kBLGFBGQl9q86xwpi8wsI S+z70AQ2U1QgROLZhOdQcwQlTs58AtYrIqAu8ehSN1g9s4CPxLHd98HmCwPZvT8vMkPMzJH4 /fYZ2HxOgUCJc+c/MkLU20pcmHOdBcKWl9j+dg5UvZzEnQaQXRxA9ytIXF/uP4FRaBaSzbOQ dM9C0r2AkXkVo3hxWWJyRqZpQXFuSYGhXkFqYraZXl5qySZGUCSnnJbbwTh9qeIhRgEORiUe XsG+lX5CrIllxZW5hxglOJiVRHilvYBCvCmJlVWpRfnxRaU5qcWHGLWBQTaRWYo7OR+YZPJK 4o0NDJTEeTfkLPcTEkgHpoHs1NSC1CKYaiYOTqkGRpPVvSYzfu5VcGi6VN29951c27Qp03JX f9D6t6uXocx0vapLfpjuBZam7FirkKyarolvgplcH35f/sTm9RWnF1sdLhxkn8//Yc/DBcb3 Q5ksmX//OFD157eL6a4ZH2bobt6/+ubpzg3eYt/9ude9dfvmxOs0b2LqQZZbj45Mi7wkvXOi z/p1f0yVWIozEg21mIuKEwFP+Bw78AIAAA== X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201110/235 X-Sequence-Number: 45457 On 10/27/2011 02:13 PM, Robert Haas wrote: > If I had to guess, I'd bet that the second one is trying to spool the > resultset in memory someplace and that's driving the machine into > swap. That would be my guess too. SELECT * on a 40-million row table is a *lot* different than getting the count, which throws away the rows once it verifies they're valid. -- Shaun Thomas OptionsHouse | 141 W. Jackson Blvd. | Suite 800 | Chicago IL, 60604 312-676-8870 sthomas@peak6.com ______________________________________________ See http://www.peak6.com/email-disclaimer/ for terms and conditions related to this email