Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 4C479B5DBF2 for ; Tue, 20 Sep 2011 06:50:03 -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 02377-01 for ; Tue, 20 Sep 2011 09:49:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail-iy0-f174.google.com (mail-iy0-f174.google.com [209.85.210.174]) by mail.postgresql.org (Postfix) with ESMTP id 87EEAB5DC3C for ; Tue, 20 Sep 2011 06:49:56 -0300 (ADT) Received: by iaqq3 with SMTP id q3so433736iaq.19 for ; Tue, 20 Sep 2011 02:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=2jicsdAtJfaPFD0yDZlg5sbMdkqlmMy83AGHuCO11+U=; b=jMH6EssEOgA7Cwg5eXnAHm9XEk/qG3X3Hp4XDCpkGjKKh9UgzNnAGzMpVtGzpUXFBg adNpusmHiYyqiT77h1vDBW8mcm1A/6UJXcWf6XEhTxWUoSF2mvelY6sFe3Ab6X2HKNGA VabdUHqd/fYNj9FsIDVPPxxY2iRti6jFILzBo= Received: by 10.43.133.65 with SMTP id hx1mr1100714icc.133.1316512196170; Tue, 20 Sep 2011 02:49:56 -0700 (PDT) Received: from [192.168.1.189] ([61.199.203.168]) by mx.google.com with ESMTPS id ee29sm1490362ibb.9.2011.09.20.02.49.54 (version=SSLv3 cipher=OTHER); Tue, 20 Sep 2011 02:49:55 -0700 (PDT) Message-ID: <4E7861C1.2000607@gmail.com> Date: Tue, 20 Sep 2011 18:49:53 +0900 From: Shigeru Hanada User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 MIME-Version: 1.0 To: Etsuro Fujita CC: pgsql-hackers@postgresql.org Subject: Re: WIP: Collecting statistics on CSV file data References: <4E6DE18B.4010505@lab.ntt.co.jp> In-Reply-To: <4E6DE18B.4010505@lab.ntt.co.jp> 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=-1.899 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201109/936 X-Sequence-Number: 195125 Hi Fujita-san, (2011/09/12 19:40), Etsuro Fujita wrote: > Hi there, > > To enable file_fdw to estimate costs of scanning a CSV file more > accurately, I would like to propose a new FDW callback routine, > AnalyzeForeignTable, which allows to ANALYZE command to collect > statistics on a foreign table, and a corresponding file_fdw function, > fileAnalyzeForeignTable. Attached is my WIP patch. I think this is a very nice feature so that planner would be able to create smarter plan for a query which uses foreign tables. I took a look at the patch, and found that it couldn't be applied cleanly against HEAD. Please rebase your patch against current HEAD of master branch, rather than 9.1beta1. The wiki pages below would be helpful for you. http://wiki.postgresql.org/wiki/Submitting_a_Patch http://wiki.postgresql.org/wiki/Creating_Clean_Patches http://wiki.postgresql.org/wiki/Reviewing_a_Patch And it would be easy to use git to follow changes made by other developers in master branch. http://wiki.postgresql.org/wiki/Working_with_Git Regards, -- Shigeru Hanada