Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fO6Tr-00043E-UB for pgsql-performance@arkaria.postgresql.org; Wed, 30 May 2018 19:09:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fO6Tq-0005ws-43 for pgsql-performance@arkaria.postgresql.org; Wed, 30 May 2018 19:09:54 +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.89) (envelope-from ) id 1fO6Tp-0005wi-PZ for pgsql-performance@lists.postgresql.org; Wed, 30 May 2018 19:09:53 +0000 Received: from mail-io0-x236.google.com ([2607:f8b0:4001:c06::236]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fO6Ti-0006hK-Vs for pgsql-performance@postgresql.org; Wed, 30 May 2018 19:09:52 +0000 Received: by mail-io0-x236.google.com with SMTP id l19-v6so13143281ioj.5 for ; Wed, 30 May 2018 12:09:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lmH0wNZ/NWxZ0OG2VdlXs/EK72pBrmysQTxBVkaPzPE=; b=ELrO5+tIGxNqL1beBcrMQd43xUsDMU8GtX6Pjsr2kJHbfQM3WvjS8c/yxqjClktBj0 8BZxmrmlR3nhLNpM/zw/419ISt4lp1GkUJbIZy/VldAe7hg4uqWjokOkvxmXcwjApi1b KNrawRb7QPdYuMN22tI0vVFBxV80gmE7w2a5viHAz3cRXTazUGX8b77Ll7RVtEGzxzED pudI5cAslP7A49XxaNB7ap5BDrnyxD6TjiBS+Evu2bPjT1i2Vawy5PSFQiLovfFpumok kj+Hf99s+081+9yPj+ie+eHzZBVsSJbpxfOABcwvSUOC+UOlTrLAwrk2f8kPbJWsf6tU oO2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=lmH0wNZ/NWxZ0OG2VdlXs/EK72pBrmysQTxBVkaPzPE=; b=FZK4b3v64kHd6wlS9UFPQraLjZR464giS30EqNwbJYtwnZGJFjiNF5pmOLTTVc/MJV XFh5Mg+oKpH+ItG3FeiHxExd3zpXkOUktKjHWNYdN4LieCdcXU/QnO7ed6K/V0FIdQQF Ex7sldrP37JgHOOPPiYFDh2JkD2a9513CeTW92vxJoHqwHjcJeiZbbbPAvMn9+RFQ/2c rMQBgE4U+39qRzDxFs2Owpez3YgdELSMtoCGO6J7HnKLrBKD8cFJSx31AkkkMkWbhkEW CM1LdcNXh/xWXuHTjJDh5b0cv6iXt1eZEMxJWvIDwxUIErp+T5ahflde03rfORpQ0EgB u5mQ== X-Gm-Message-State: APt69E17JFKsPScIlD5l1vjzj+ekDmZOYg9HzuNPLqdat/t+4RmUITQa X0n6y9AEk5isPUlmndSL9PBw/A== X-Google-Smtp-Source: ADUXVKL+QI1Km5JLP8NuhF3awMpCqJq7sqRrzGrP8P1B85lAkr1q2/hW4MkdlO+t2XKKktBSCBNMCA== X-Received: by 2002:a6b:2190:: with SMTP id h138-v6mr3203238ioh.181.1527707385862; Wed, 30 May 2018 12:09:45 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id y2-v6sm9984633ita.31.2018.05.30.12.09.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 May 2018 12:09:45 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id 9013980186B; Wed, 30 May 2018 14:09:44 -0500 (CDT) Date: Wed, 30 May 2018 14:09:44 -0500 From: Justin Pryzby To: Christopher Wilson Cc: "pgsql-performance@postgresql.org" , Steven Winfield Subject: Re: Possible optimisation: push down SORT and LIMIT nodes Message-ID: <20180530190944.GA25841@telsasoft.com> References: <20180530190231.GH5164@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180530190231.GH5164@telsasoft.com> User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, May 30, 2018 at 02:02:31PM -0500, Justin Pryzby wrote: > For diagnostic purposes, I was able to to vastly improve the query runtime with > a CTE (WITH): I realized this was broken as soon as I sent it (for the essential reason of discarding rows before having sorted them). Sorry for the noise. Justin