Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCJIv-00046p-CG for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jun 2016 04:16:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bCJIt-0007rQ-PF for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jun 2016 04:16:47 +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 1bCJIr-0007qh-Bn for pgsql-hackers@postgresql.org; Mon, 13 Jun 2016 04:16:45 +0000 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCJIm-0006ct-Jm for pgsql-hackers@postgresql.org; Mon, 13 Jun 2016 04:16:43 +0000 Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id u5D4Gc9G020025 for ; Mon, 13 Jun 2016 13:16:38 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 0D2E65F611 for ; Mon, 13 Jun 2016 13:16:38 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id EAACA5F594 for ; Mon, 13 Jun 2016 13:16:37 +0900 (JST) Received: from [127.0.0.1] (unknown [129.60.241.68]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTP id DC2F7400352 for ; Mon, 13 Jun 2016 13:16:37 +0900 (JST) Message-ID: <575E339E.1000502@lab.ntt.co.jp> Date: Mon, 13 Jun 2016 13:16:30 +0900 From: Tatsuro Yamada User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 Subject: Re: ERROR: ORDER/GROUP BY expression not found in targetlist References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit To: pgsql-hackers@postgresql.org X-TM-AS-MML: disable X-Pg-Spam-Score: -4.0 (----) 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 Hi, I tried to run tpc-h queries, but some queries failed by the error on last week. >Subject: Re: [HACKERS] ORDER/GROUP BY expression not found in targetlist >Date: Thu, 09 Jun 2016 12:08:01 +0900 Today, I try it again by changing max_parallel_workers_per_gather parameter. The result of Q1 is bellow. Is this bug in the Open items on wiki? ------------- postgres=# set max_parallel_workers_per_gather = 0; SET postgres=# \i queries/1.explain.sql QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------- Limit (cost=43474.03..43474.03 rows=1 width=236) (actual time=1039.583..1039.583 rows=1 loops=1) -> Sort (cost=43474.03..43474.04 rows=6 width=236) (actual time=1039.583..1039.583 rows=1 loops=1) Sort Key: l_returnflag, l_linestatus Sort Method: top-N heapsort Memory: 25kB -> HashAggregate (cost=43473.83..43474.00 rows=6 width=236) (actual time=1039.529..1039.534 rows=4 loops=1) Group Key: l_returnflag, l_linestatus -> Seq Scan on lineitem (cost=0.00..19668.15 rows=595142 width=25) (actual time=0.048..125.332 rows=595224 loops=1) Filter: (l_shipdate <= '1998-09-22 00:00:00'::timestamp without time zone) Rows Removed by Filter: 5348 Planning time: 0.180 ms Execution time: 1039.758 ms (11 rows) postgres=# set max_parallel_workers_per_gather = default; SET postgres=# \i queries/1.explain.sql ERROR: ORDER/GROUP BY expression not found in targetlist ------------- Regards, Tatsuro Yamada NTT OSS Center On 2016/06/13 12:39, Thomas Munro wrote: > Hi, > > What is going on here? > > postgres=# create table logs as select generate_series(1, > 1000000)::text as data; > SELECT 1000000 > postgres=# insert into logs select * from logs; > INSERT 0 1000000 > postgres=# insert into logs select * from logs; > INSERT 0 2000000 > postgres=# insert into logs select * from logs; > INSERT 0 4000000 > postgres=# insert into logs select * from logs; > INSERT 0 8000000 > postgres=# insert into logs select * from logs; > INSERT 0 16000000 > postgres=# analyze logs; > ANALYZE > postgres=# set max_parallel_workers_per_gather = 0; > SET > postgres=# explain select length(data) from logs group by length(data); > ┌────────────────────────────────────────────────────────────────────────────┐ > │ QUERY PLAN │ > ├────────────────────────────────────────────────────────────────────────────┤ > │ Group (cost=5843157.07..6005642.13 rows=993989 width=4) │ > │ Group Key: (length(data)) │ > │ -> Sort (cost=5843157.07..5923157.11 rows=32000018 width=4) │ > │ Sort Key: (length(data)) │ > │ -> Seq Scan on logs (cost=0.00..541593.22 rows=32000018 width=4) │ > └────────────────────────────────────────────────────────────────────────────┘ > (5 rows) > > postgres=# set max_parallel_workers_per_gather = 2; > SET > postgres=# explain select length(data) from logs group by length(data); > ERROR: ORDER/GROUP BY expression not found in targetlist > -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers