Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id ED72DB5DBFD for ; Tue, 18 Oct 2011 02:37:21 -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 56678-07 for ; Tue, 18 Oct 2011 05:37:15 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from tama500.ecl.ntt.co.jp (tama500.ecl.ntt.co.jp [129.60.39.148]) by mail.postgresql.org (Postfix) with ESMTP id B2D4FB5DBFB for ; Tue, 18 Oct 2011 02:37:13 -0300 (ADT) Received: from mfs6.rdh.ecl.ntt.co.jp (mfs6.rdh.ecl.ntt.co.jp [129.60.39.149]) by tama500.ecl.ntt.co.jp (8.14.5/8.14.5) with ESMTP id p9I5bAQY029950; Tue, 18 Oct 2011 14:37:10 +0900 (JST) Received: from mfs6.rdh.ecl.ntt.co.jp (localhost [127.0.0.1]) by mfs6.rdh.ecl.ntt.co.jp (Postfix) with ESMTP id 308BC68A8; Tue, 18 Oct 2011 14:37:10 +0900 (JST) Received: from dmailsv1.y.ecl.ntt.co.jp (dmailsv1.y.ecl.ntt.co.jp [129.60.53.14]) by mfs6.rdh.ecl.ntt.co.jp (Postfix) with ESMTP id 0B8036843; Tue, 18 Oct 2011 14:37:10 +0900 (JST) Received: from mailsv01.y.ecl.ntt.co.jp by dmailsv1.y.ecl.ntt.co.jp (8.14.4/dmailsv1-2.1) with ESMTP id p9I5b9XG004949; Tue, 18 Oct 2011 14:37:09 +0900 (JST) Received: from localhost by mailsv01.y.ecl.ntt.co.jp (8.14.5/Lab-1.9) with ESMTP id p9I5b95w003928; Tue, 18 Oct 2011 14:37:09 +0900 (JST) Message-ID: <4E9D126F.5010508@lab.ntt.co.jp> Date: Tue, 18 Oct 2011 14:45:19 +0900 From: Etsuro Fujita User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; ja; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: Shigeru Hanada CC: pgsql-hackers@postgresql.org Subject: Re: WIP: Collecting statistics on CSV file data References: <4E6DE18B.4010505@lab.ntt.co.jp> <4E7861C1.2000607@gmail.com> <4E8EC1D8.3080700@lab.ntt.co.jp> <4E9C6573.8050507@gmail.com> In-Reply-To: <4E9C6573.8050507@gmail.com> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201110/975 X-Sequence-Number: 196781 (2011/10/18 2:27), Shigeru Hanada wrote: > The new patch could be applied with some shifts. Regression tests of > core and file_fdw have passed cleanly. Though I've tested only simple > tests, ANALYZE works for foreign tables for file_fdw, and estimation of > costs and selectivity seem appropriate. Thank you for your testing. > New API AnalyzeForeignTable > =========================== > And I think that AnalyzeForeignTable should be optional, and it would be > very useful if a default handler is provided. Probably a default > handler can use basic FDW APIs to acquire sample rows from the result of > "SELECT * FROM foreign_table" with skipping periodically. It won't be > efficient but I think it's not so unreasonable. I agree with you. However, I think that it is difficult to support such a default handler in a unified way because there exist external data sources for which we cannot execute "SELECT * FROM foreign_table", e.g., web-accessible DBs limiting full access to the contents. > Other issues > ============ > There are some other comments about non-critical issues. > - When there is no analyzable column, vac_update_relstats is not called. > Is this behavior intentional? > - psql can't complete foreign table name after ANALYZE. > - A new parameter has been added to vac_update_relstats in a recent > commit. Perhaps 0 is OK for that parameter. I'll check. > - ANALYZE without relation name ignores foreign tables because > get_rel_oids doesn't list foreign tables. I think that it might be better to ignore foreign tables by default because analyzing such tables may take long depending on FDW. > - IMO logging "analyzing foo.bar" should not be done in > AnalyzeForeignTable handler of each FDW because some FDW might forget to > do it. Maybe it should be pulled up to analyze_rel or somewhere in core. > - It should be mentioned in a document that foreign tables are not > analyzed automatically because they are read-only. OK. I'll revise. > Regards, Best regards, Etsuro Fujita