Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cy0bw-0006Ft-Ay for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Apr 2017 18:33:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cy0bv-0006Ed-KU for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Apr 2017 18:33:51 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cy0bu-0006ET-OK for pgsql-hackers@postgresql.org; Tue, 11 Apr 2017 18:33:51 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cy0br-0000MV-G6 for pgsql-hackers@postgresql.org; Tue, 11 Apr 2017 18:33:49 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id C523421C27FD; Tue, 11 Apr 2017 21:33:44 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Received: from localhost (unknown [92.243.181.54]) by mail.postgrespro.ru (Postfix) with ESMTPSA id 8AA0B21C27F3; Tue, 11 Apr 2017 21:33:44 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1491935624; bh=soImb/j386tepCIuLMJsjMTs5s8SIL1F7IG9xgl9vAI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=L1qKrFclBkYY2OKAERZM6BPUxGce73R6evJ9mRM0Ud99EKj6Dqhvb/cbHBwNFnkhD +0a3TzEGfweVL+leiwc1pcJmxRaUYC1YOMWZ9QEmQaB2sW7omCctlEPqCzRWoUfaVC VsgZnTC1IWXeBCplgwnfT96R1S/rKSCd7PsnQvKQ= From: Dmitry Ivanov To: Tom Lane Cc: Dmitry Ivanov , pgsql-hackers Subject: Re: Possible problem in Custom Scan API Date: Tue, 11 Apr 2017 21:33:15 +0300 MIME-Version: 1.0 Message-ID: <1ef85b46-1385-4810-bb80-97cd977da1d5@postgrespro.ru> In-Reply-To: <20021.1491933424@sss.pgh.pa.us> References: <20021.1491933424@sss.pgh.pa.us> Organization: Postgres Professional User-Agent: Trojita/0.7; Qt/5.8.0; xcb; Linux; Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Tom Lane wrote: > Uh, why would you see that? The planner would never generate an > IndexOnlyScan in the first place if the query required any columns > not available from the index. True, but as you can see, create_append_plan() produces its own targetlist: static Plan * create_append_plan(PlannerInfo *root, AppendPath *best_path) { Append *plan; List *tlist =3D build_path_tlist(root, &best_path->path); ... If we replace Append with some custom node, the plan will instantly become= =20 invalid (it won't be be able to build a projection from 'custom_scan_tlist'= =20 to 'targetlist'). However, this doesn't mean that it's unable to produce=20 the same result. --=20 Dmitry Ivanov Postgres Professional: http://www.postgrespro.com Russian Postgres Company --=20 Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers