Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a3npN-0004NF-Bp for pgsql-committers@arkaria.postgresql.org; Tue, 01 Dec 2015 16:30:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a3npM-0007OB-V0 for pgsql-committers@arkaria.postgresql.org; Tue, 01 Dec 2015 16:30:52 +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_SHA384:256) (Exim 4.84) (envelope-from ) id 1a3npA-0007Ad-Ov for pgsql-committers@postgresql.org; Tue, 01 Dec 2015 16:30:40 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1a3np6-0002K3-Kk; Tue, 01 Dec 2015 16:30:40 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1a3np4-0000nP-AY; Tue, 01 Dec 2015 11:30:34 -0500 Date: Tue, 1 Dec 2015 11:30:34 -0500 From: Bruce Momjian To: Robert Haas Cc: pgsql-committers@postgresql.org Subject: Re: pgsql: postgres_fdw: Add ORDER BY to some remote SQL queries. Message-ID: <20151201163034.GA1367@momjian.us> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org On Tue, Nov 3, 2015 at 06:05:11PM +0000, Robert Haas wrote: > postgres_fdw: Add ORDER BY to some remote SQL queries. > > If the join problem's entire ORDER BY clause can be pushed to the > remote server, consider a path that adds this ORDER BY clause. If > use_remote_estimate is on, we cost this path using an additional > remote EXPLAIN. If not, we just estimate that the path costs 20% > more, which is intended to be large enough that we won't request a > remote sort when it's not helpful, but small enough that we'll have > the remote side do the sort when in doubt. In some cases, the remote > sort might actually be free, because the remote query plan might > happen to produce output that is ordered the way we need, but without > remote estimates we have no way of knowing that. > > It might also be useful to request sorted output from the remote side > if it enables an efficient merge join, but this patch doesn't attempt > to handle that case. Does this complete FDW join pushdown? -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Roman grave inscription + -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers