Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHMPq-0001ls-Qk for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Jun 2016 02:36:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bHMPp-0000VI-SR for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Jun 2016 02:36:49 +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 1bHMOR-0007RT-PD for pgsql-hackers@postgresql.org; Mon, 27 Jun 2016 02:35:23 +0000 Received: from mail-pa0-x22a.google.com ([2607:f8b0:400e:c03::22a]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bHMOO-0001aC-S9 for pgsql-hackers@postgresql.org; Mon, 27 Jun 2016 02:35:22 +0000 Received: by mail-pa0-x22a.google.com with SMTP id bz2so54202918pad.1 for ; Sun, 26 Jun 2016 19:35:20 -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=Zt/SuKfibLsLp+xiO9Z/hmk1FKIMmICrX9M72+GY6eU=; b=WQ4IUVtqkZxnynUiUksf7bcGNjjYpQQSJTz6942f+cNPCutsemhQa5qr9VkuvA2GP5 21Eqa04Dr18rrvjbPDeKIXd+n5IxafrqIylbtPLpUjc8M9BrXoVnDdDkL3pQkeyfyVhg cpL+8CrSqjbDgPh83G8wdXVh18vRD1fpWvEHc= 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=Zt/SuKfibLsLp+xiO9Z/hmk1FKIMmICrX9M72+GY6eU=; b=lxg9t7jwkFpShnoZt8wXnclOvHPoTAJMVVtHyZ6kAz+ei2Ii+m8YnOs/vGHfa5+Sq+ 23DZXP4HRM5o9/fyDld3aNAxwQhfkwskGfBAr5q6qEJJxFkh2TGwzzo9InYA1ZShRDPl kbJiXplyUptSyS/UPSzBl8HEeppeRoFhRKlPSXhhWufF/hUwNDTSL5MXh2sO7KrjWKoh AHHHmSb/kyFds6il+S6O/S1/auIKIYNi2lISuL0qCSsd0dEaEbJ5coMm7gRhmJ+Jixug ReE422+Pzg4H9Sl6teDN02m0H+E4sMyKYyWaiEJigjg573ur8i4mQucLvFnzPl7LFGka +gzw== X-Gm-Message-State: ALyK8tLT4adCODDvSTUEZCt3OsWixog7TMEgMkfyMLEE27qf1YH/MF7wdytMBdxn5VY/Vg== X-Received: by 10.66.25.133 with SMTP id c5mr29613925pag.103.1466994919846; Sun, 26 Jun 2016 19:35:19 -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 p187sm2082968pfg.67.2016.06.26.19.35.18 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 26 Jun 2016 19:35:19 -0700 (PDT) Date: Sun, 26 Jun 2016 22:35:17 -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: <20160627023517.GA1329944@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1597.1465846969@sss.pgh.pa.us> 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 03:42:49PM -0400, Tom Lane wrote: > I wrote: > > ... there was also an unexplainable plan change: > > > *** /home/postgres/pgsql/src/test/regress/expected/aggregates.out Thu Apr 7 21:13:14 2016 > > --- /home/postgres/pgsql/src/test/regress/results/aggregates.out Mon Jun 13 11:54:01 2016 > > *************** > > *** 577,590 **** > > > explain (costs off) > > select max(unique1) from tenk1 where unique1 > 42000; > > ! QUERY PLAN > > ! --------------------------------------------------------------------------- > > ! Result > > ! InitPlan 1 (returns $0) > > ! -> Limit > > ! -> Index Only Scan Backward using tenk1_unique1 on tenk1 > > ! Index Cond: ((unique1 IS NOT NULL) AND (unique1 > 42000)) > > ! (5 rows) > > > select max(unique1) from tenk1 where unique1 > 42000; > > max > > --- 577,588 ---- > > > explain (costs off) > > select max(unique1) from tenk1 where unique1 > 42000; > > ! QUERY PLAN > > ! ---------------------------------------------------- > > ! Aggregate > > ! -> Index Only Scan using tenk1_unique1 on tenk1 > > ! Index Cond: (unique1 > 42000) > > ! (3 rows) > > > select max(unique1) from tenk1 where unique1 > 42000; > > max > > > I would not be surprised at a change to a parallel-query plan, but there's > > no parallelism here, so what happened? This looks like a bug to me. > > (Also, doing this query without COSTS OFF shows that the newly selected > > plan actually has a greater estimated cost than the expected plan, which > > makes it definitely a bug.) > > I looked into this and found that the costs are considered fuzzily the > same, and then add_path prefers the slightly-worse path on the grounds > that it is marked parallel_safe while the MinMaxAgg path is not. It seems > to me that there is some fuzzy thinking going on there. On exactly what > grounds is a path to be preferred merely because it is parallel safe, and > not actually parallelized? Or perhaps the question to ask is whether a > MinMaxAgg path can be marked parallel-safe. [Action required within 72 hours. This is a generic notification.] The above-described topic is currently a PostgreSQL 9.6 open item ("consider whether MinMaxAggPath might fail to be parallel-safe"). 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