Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHMV9-0001yw-3R for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Jun 2016 02:42:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bHMV8-0002Be-Hm for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Jun 2016 02:42:18 +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_2) (envelope-from ) id 1bHMV7-0002Ar-Cw for pgsql-hackers@postgresql.org; Mon, 27 Jun 2016 02:42:17 +0000 Received: from mail-pa0-x236.google.com ([2607:f8b0:400e:c03::236]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bHMV4-00025z-51 for pgsql-hackers@postgresql.org; Mon, 27 Jun 2016 02:42:16 +0000 Received: by mail-pa0-x236.google.com with SMTP id b13so54303377pat.0 for ; Sun, 26 Jun 2016 19:42:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=sDKl+IOPcRlnjqd2hAgjtwyJmSX5ALi2rDId8jCWNnc=; b=UNJEK0Oee9upvZb7DvSXGu8UG4WQfKmSXhmhxU6UtrNKAY2Z8+a4b/azJL9Uyu13mR +wNya0is4gaM2IMKbPs1LxzBZWGUHGOaPCKAHjcpGK8yO7hKtPjWgKjYb4Z26V1k57Tk LU6tYxlpEu1igf0wBtbFSIHjczNIGt6yLIp+s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=sDKl+IOPcRlnjqd2hAgjtwyJmSX5ALi2rDId8jCWNnc=; b=Z2X7tV90oYuS5AjkVUv3Ze5u9JafFQ3Nvgf2/duGQe48/3eCZZ5c3JHd2lzsSrC0Pk hTIbgxXsG+tSxYsfd9/1R8mCc7CD5Q6Xj9SC/iQ+1diACu4lA18VSnLhFoHrLQ8f8+Oy qitCGtEbQOLvumWpUR9ivQ2AvMkim3ljsfSelISOHGA976ziuf9rjtccNPmXueFBXw0i iptPITujPo4kKBGLCpdcNfgzg63JG7Hv5JJU5bRUGFBMzE7HearpgXyvUMc7XbUJRrYC u07NOzYVWRJGTzOH/1ff5Q11eC58qT3wtacBggrJc11tANa595S8Yg2q6vxFKSawkvQm yZdA== X-Gm-Message-State: ALyK8tLM0UrUfdBNnFDQTsd9nazlnO6lpSHsTfxBZk9kOw+xTF17v1H7EL2tNf8dlTrVdA== X-Received: by 10.66.196.203 with SMTP id io11mr29558638pac.107.1466995331821; Sun, 26 Jun 2016 19:42:11 -0700 (PDT) Received: from tornado.leadboat.com (c-98-248-47-228.hsd1.ca.comcast.net. [98.248.47.228]) by smtp.gmail.com with ESMTPSA id r7sm2395277pfa.3.2016.06.26.19.42.10 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 26 Jun 2016 19:42:11 -0700 (PDT) Date: Sun, 26 Jun 2016 22:42:09 -0400 From: Noah Misch To: Robert Haas Cc: Tom Lane , Amit Kapila , David Rowley , Thomas Munro , Pg Hackers Subject: Re: ERROR: ORDER/GROUP BY expression not found in targetlist Message-ID: <20160627024209.GC1329944@tornado.leadboat.com> References: <15695.1465827695@sss.pgh.pa.us> <17170.1465830165@sss.pgh.pa.us> <20756.1465834072@sss.pgh.pa.us> <1597.1465846969@sss.pgh.pa.us> <20391.1465850779@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Pg-Spam-Score: -2.7 (--) 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 On Mon, Jun 13, 2016 at 05:27:13PM -0400, Robert Haas wrote: > One problem that I've realized that is related to this is that the way > that the consider_parallel flag is being set for upper rels is almost > totally bogus, which I believe accounts for your complaint at PGCon > that force_parallel_mode was not doing as much as it ought to do. > When I originally wrote a lot of this logic, there were no upper rels, > which led to this code: > > if (force_parallel_mode == FORCE_PARALLEL_OFF || !glob->parallelModeOK) > { > glob->parallelModeNeeded = false; > glob->wholePlanParallelSafe = false; /* either > false or don't care */ > } > else > { > glob->parallelModeNeeded = true; > glob->wholePlanParallelSafe = > !has_parallel_hazard((Node *) parse, false); > } > > The main way that wholePlanParallelSafe is supposed to be cleared is > in create_plan: > > /* Update parallel safety information if needed. */ > if (!best_path->parallel_safe) > root->glob->wholePlanParallelSafe = false; > > However, at the time that code was written, it was impossible to rely > entirely on the latter mechanism. Since there were no upper rels and > no paths for upper plan nodes, you could have the case where every > path was parallel-safe but the whole plan was node. Therefore the > code shown above was needed to scan the whole darned plan for > parallel-unsafe things. Post-pathification, this whole thing is > pretty bogus: upper rels mostly don't get consider_parallel set at > all, which means plans involving upper rels get marked parallel-unsafe > even if they are not, which means the wholePlanParallelSafe flag gets > cleared in a bunch of cases where it shouldn't. And on the flip side > I think that the first chunk of code quoted above would be totally > unnecessary if we were actually setting consider_parallel correctly on > the upper rels. [Action required within 72 hours. This is a generic notification.] The above-described topic is currently a PostgreSQL 9.6 open item ("set consider_parallel correctly for upper rels"). Robert, since you committed the patch believed to have created it, you own this open item. If some other commit is more relevant or if this does not belong as a 9.6 open item, please let us know. Otherwise, please observe the policy on open item ownership[1] and send a status update within 72 hours of this message. Include a date for your subsequent status update. Testers may discover new open items at any time, and I want to plan to get them all fixed well in advance of shipping 9.6rc1. Consequently, I will appreciate your efforts toward speedy resolution. Thanks. [1] http://www.postgresql.org/message-id/20160527025039.GA447393@tornado.leadboat.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers