Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id A252FB5DBCA for ; Tue, 27 Sep 2011 21:55:23 -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 34571-08 for ; Wed, 28 Sep 2011 00:55:17 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail-vw0-f46.google.com (mail-vw0-f46.google.com [209.85.212.46]) by mail.postgresql.org (Postfix) with ESMTP id 72214B5DBBD for ; Tue, 27 Sep 2011 21:55:17 -0300 (ADT) Received: by vws1 with SMTP id 1so7105928vws.19 for ; Tue, 27 Sep 2011 17:55:17 -0700 (PDT) Received: by 10.52.29.51 with SMTP id g19mr8272619vdh.381.1317171317168; Tue, 27 Sep 2011 17:55:17 -0700 (PDT) Received: from ayaki.localdomain (58-7-170-220.dyn.iinet.net.au. [58.7.170.220]) by mx.google.com with ESMTPS id e7sm21683406vdh.25.2011.09.27.17.55.14 (version=SSLv3 cipher=OTHER); Tue, 27 Sep 2011 17:55:16 -0700 (PDT) Message-ID: <4E827070.4040801@ringerc.id.au> Date: Wed, 28 Sep 2011 08:55:12 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 MIME-Version: 1.0 To: Venkat Balaji CC: Kevin Grittner , PGSQL Performance Subject: Re: : Tracking Full Table Scans References: <4E81981E02000025000417AA@gw.wicourts.gov> 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: 201109/405 X-Sequence-Number: 45181 On 09/28/2011 12:26 AM, Venkat Balaji wrote: > Thanks a lot Kevin !! > > Yes. I intended to track full table scans first to ensure that only > small tables or tables with very less pages are (as you said) getting > scanned full. It can also be best to do a full table scan of a big table for some queries. If the query needs to touch all the data in a table - for example, for an aggregate - then the query will often complete fastest and with less disk use by using a sequential scan. I guess what you'd really want to know is to find out about queries that do seqscans to match relatively small fractions of the total tuples scanned, ie low-selectivity seqscans. I'm not sure whether or not it's possible to gather this data with PostgreSQL's current level of stats detail. -- Craig Ringer