Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 1345AB5DC6B for ; Tue, 20 Sep 2011 21:24:53 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 99485-01-5 for ; Wed, 21 Sep 2011 00:24:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from fetter.org (173-164-140-181-SFBA.hfc.comcastbusiness.net [173.164.140.181]) by mail.postgresql.org (Postfix) with ESMTP id 955D2B5DEFB for ; Tue, 20 Sep 2011 21:22:33 -0300 (ADT) Received: by fetter.org (Postfix, from userid 500) id 868AA3C1D1B; Tue, 20 Sep 2011 17:22:32 -0700 (PDT) Date: Tue, 20 Sep 2011 17:22:32 -0700 From: David Fetter To: Tom Lane Cc: Marti Raudsepp , Etsuro Fujita , pgsql-hackers@postgresql.org Subject: Re: WIP: Collecting statistics on CSV file data Message-ID: <20110921002232.GA18333@fetter.org> References: <4E6DE18B.4010505@lab.ntt.co.jp> <8240.1316531585@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8240.1316531585@sss.pgh.pa.us> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.918 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RDNS_DYNAMIC=0.982 X-Spam-Level: X-Archive-Number: 201109/991 X-Sequence-Number: 195180 On Tue, Sep 20, 2011 at 11:13:05AM -0400, Tom Lane wrote: > Marti Raudsepp writes: > > 2011/9/12 Etsuro Fujita : > >> This is called when ANALYZE command is executed. (ANALYZE > >> command should be executed because autovacuum does not analyze foreign > >> tables.) > > > This is a good idea. > > > However, if adding these statistics requires an explicit ANALYZE > > command, then we should also have a command for resetting the > > collected statistics -- to get it back into the un-analyzed state. > > Uh, why? There is no UNANALYZE operation for ordinary tables, and > I've never heard anyone ask for one. > > If you're desperate you could manually delete the relevant rows in > pg_statistic, a solution that would presumably work for foreign tables > too. > > Probably a more interesting question is why we wouldn't change > autovacuum so that it calls this automatically for foreign tables. How about a per-table setting that tells autovacuum whether to do this? Come to think of it, all of per-FDW, per-remote and per-table settings would be handy, so people could express things like, "all CSV files except these three, all PostgreSQL connections on the 10.1.0.0/16 network, and these two tables in Oracle." Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fetter@gmail.com iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate