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 1gBuLL-0001TS-8T for pgsql-bugs@arkaria.postgresql.org; Mon, 15 Oct 2018 04:18:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gBuLJ-0003y9-LN for pgsql-bugs@arkaria.postgresql.org; Mon, 15 Oct 2018 04:18:57 +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 1gBuLJ-0003y2-CH for pgsql-bugs@lists.postgresql.org; Mon, 15 Oct 2018 04:18:57 +0000 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gBuLE-0004Ky-Oz; Mon, 15 Oct 2018 04:18:55 +0000 Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id w9F4Imdn011889; Mon, 15 Oct 2018 13:18:48 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id DE53E6389A0; Mon, 15 Oct 2018 13:18:48 +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 D304A63895F; Mon, 15 Oct 2018 13:18:48 +0900 (JST) Received: from [127.0.0.1] (unknown [129.60.241.61]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id C7C7A400A3B; Mon, 15 Oct 2018 13:18:48 +0900 (JST) Subject: Re: BUG #15430: partition-wise join only works in combination with pruning on 1 partition References: <15430-ee54c4208e54e9b1@postgresql.org> From: Amit Langote Message-ID: Date: Mon, 15 Oct 2018 13:18:39 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <15430-ee54c4208e54e9b1@postgresql.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-CC-Mail-RelayStamp: 1 To: agile.data.analytics@gmail.com, pgsql-bugs@lists.postgresql.org, PG Bug reporting form X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2018/10/15 0:20, PG Bug reporting form wrote: > The following bug has been logged on the website: > > Bug reference: 15430 > Logged by: Bart Debersaques > Email address: agile.data.analytics@gmail.com > PostgreSQL version: 11rc1 > Operating system: Centos 7 > Description: [ ... ] > psql <<-EOF > explain > select * > from > part_test.measurement m1 > inner join part_test.measurement2 m2 > on m1.city_id = m2.city_id and m1.logdate = m2.logdate > where m1.logdate in ('2006-02-01'::date, '2006-03-01'::date)
EOF > # Hash Join (cost=66.97..170.25 rows=3 width=32) > # Hash Cond: ((m2.city_id = m1.city_id) AND (m2.logdate = m1.logdate)) > # -> Append (cost=0.00..75.50 rows=3700 width=16) > # -> Seq Scan on measurement2_y2006m02 m2 (cost=0.00..28.50 > rows=1850 width=16) > # -> Seq Scan on measurement2_y2006m03 m2_1 (cost=0.00..28.50 > rows=1850 width=16) > # -> Hash (cost=66.43..66.43 rows=36 width=16) > # -> Append (cost=0.00..66.43 rows=36 width=16) > # -> Seq Scan on measurement_y2006m02 m1 (cost=0.00..33.12 > rows=18 width=16) > # Filter: (logdate = ANY > ('{2006-02-01,2006-03-01}'::date[])) > # -> Seq Scan on measurement_y2006m03 m1_1 (cost=0.00..33.12 > rows=18 width=16) > # Filter: (logdate = ANY > ('{2006-02-01,2006-03-01}'::date[])) > > # conclusion: join performed on full tab scans, join not performed on a > per-partion basis Have you changed the value of enable_partitionwise_join parameter to 'on'? It's 'off' by default, so join is not performed on per-partition basis. Thanks, Amit