Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gxCcK-0007jG-Fl for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Feb 2019 15:20:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gxCcJ-0004G4-0I for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Feb 2019 15:19:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gxCcI-0004Fx-OZ for pgsql-hackers@lists.postgresql.org; Fri, 22 Feb 2019 15:19:58 +0000 Received: from mx2a.mailbox.org ([2001:67c:2050:104:0:2:25:2] helo=mx2.mailbox.org) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gxCcG-0004zg-5G for pgsql-hackers@postgresql.org; Fri, 22 Feb 2019 15:19:58 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 3E331A1325; Fri, 22 Feb 2019 16:19:53 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=MBO0001; t=1550848791; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=85pNoGICn5JTPMRo5Jyf2ngP/eGhBxYUIodYQeSTXYM=; b=WnnG+rKUfCT42Y+IbPCz6iMDYOHh+2aebUPz/0kUJq1TTU6EUvm0ih1Ja7Db796Nd1gEDL G5xsxhLT4Xn0YigHQTMhUfPMgK0S7PKwJ+MF+dme3Ut8Tl5Pg+dAAoXqSpIPcb9rO1oGo3 goU7299OadOwXQJJ6H0x2bUIm+k6UpoordIucNpEsYDasy5upvW/oSTQY8QhA43zTd9rUs CXKpSqMhyaicQUSDEadtPOjr6petGIGL8/HwoiJoLIc66Tr959G1OcaWCo93u6D69Kanr8 YOGn6Zm/XQLf7QfeJULQFmPNaXYp7xoetVMvykzDuEwNlbHyl/LQsDd76rR7vQ== Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter05.heinlein-hosting.de (spamfilter05.heinlein-hosting.de [80.241.56.123]) (amavisd-new, port 10030) with ESMTP id WrOWJSFDHJ36; Fri, 22 Feb 2019 16:19:43 +0100 (CET) From: Antonin Houska To: Etsuro Fujita cc: Tom Lane , Andrew Gierth , pgsql-hackers@postgresql.org Subject: Re: Problems with plan estimates in postgres_fdw In-reply-to: <5C6D474F.5010703@lab.ntt.co.jp> References: <87pnz1aby9.fsf@news-spur.riddles.org.uk> <1175.1533220908@sss.pgh.pa.us> <5BB739CD.6040002@lab.ntt.co.jp> <5BBC4140.50403@lab.ntt.co.jp> <5C17A00E.5000005@lab.ntt.co.jp> <5C232F39.9060509@lab.ntt.co.jp> <5C25C7B5.2010802@lab.ntt.co.jp> <5C518631.5080401@lab.ntt.co.jp> <10994.1549559088@localhost> <5C5D778F.3080501@lab.ntt.co.jp> <5C6D474F.5010703@lab.ntt.co.jp> Comments: In-reply-to Etsuro Fujita message dated "Wed, 20 Feb 2019 21:25:51 +0900." MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <30938.1550848901.1@localhost> Date: Fri, 22 Feb 2019 16:21:41 +0100 Message-ID: <30939.1550848901@localhost> Authentication-Results: default_out X-Rspamd-Queue-Id: 5A41C16FE List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Etsuro Fujita wrote: > (2019/02/08 21:35), Etsuro Fujita wrote: > > (2019/02/08 2:04), Antonin Houska wrote: > >> * regression tests: I think test(s) should be added for queries that have > >> ORDER BY clause but do not have GROUP BY (and also no LIMIT / OFFSET) > >> clause. I haven't noticed such tests. > > > > Will do. > > I noticed that such queries would be processed by what we already have for > sort pushdown (ie, add_paths_with_pathkeys_for_rel()). I might be missing > something, though. What about an ORDER BY expression that contains multiple Var nodes? For example SELECT * FROM foo ORDER BY x + y; I think the base relation should not be able to generate paths with the corresponding pathkeys, since its target should (besides PlaceHolderVars, which should not appear in the plan of this simple query at all) only emit individual Vars. -- Antonin Houska https://www.cybertec-postgresql.com