Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h8Exe-0007lt-Un for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Mar 2019 02:03:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h8Exc-00054u-Vn for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Mar 2019 02:03:36 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1h8Exc-00054n-OW for pgsql-hackers@lists.postgresql.org; Mon, 25 Mar 2019 02:03:36 +0000 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h8ExU-0000rq-Ha for pgsql-hackers@lists.postgresql.org; Mon, 25 Mar 2019 02:03:36 +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 x2P23KqN006019; Mon, 25 Mar 2019 11:03:20 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 0F6A263875D; Mon, 25 Mar 2019 11:03:20 +0900 (JST) Received: from jcms-pop11.ecl.ntt.co.jp (jcms-pop11.ecl.ntt.co.jp [129.60.87.132]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 0417A6386CD; Mon, 25 Mar 2019 11:03:20 +0900 (JST) Received: from hosoyahp (unknown [129.60.241.74]) by jcms-pop11.ecl.ntt.co.jp (Postfix) with ESMTPSA id F16D370C07A8; Mon, 25 Mar 2019 11:03:19 +0900 (JST) From: "Yuzuko Hosoya" References: <00e601d4ca86$932b8bc0$b982a340$@lab.ntt.co.jp> <010e01d4ce68$c0427b10$40c77130$@lab.ntt.co.jp> <0F97FA9ABBDBE54F91744A9B37151A5129A78A@g01jpexmbkw24> <001901d4daf5$1ef4f640$5cdee2c0$@lab.ntt.co.jp> <9bed6b79-f264-6976-b880-e2a5d23e9d85@lab.ntt.co.jp> <003501d4de21$8816f540$9844dfc0$@lab.ntt.co.jp> <9bb31dfe-b0d0-53f3-3ea6-e64b811424cf@lab.ntt.co.jp> <005101d4e074$e24d1e40$a6e75ac0$@lab.ntt.co.jp> <001ea23e-638f-9ab2-143d-2cf1105bf8d6@lab.ntt.co.jp> <6213e860-c93b-1934-f5d4-bc3f5999e3af@dalibo.com> In-Reply-To: Subject: RE: Problem with default partition pruning Date: Mon, 25 Mar 2019 11:03:05 +0900 Message-ID: <005801d4e2ae$e29e5080$a7daf180$@lab.ntt.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 15.0 Content-language: ja Thread-index: AQLwSThp7L0tC61luGAd4dJt3HxY3QJvrgn9AgtGZCUBpM85VAEOZ04CAeo+SK4CDbFrsgGXrNc6AV8LXc4CAoWeVAJ/vK7zAyoITl4B/o26TwHJkoRXAaGdVJOjCzJkMA== X-CC-Mail-RelayStamp: 1 To: "'Amit Langote'" , "'Thibaut Madelaine'" , "'Imai, Yoshikazu'" Cc: "'PostgreSQL Hackers'" X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, >=20 > Hi, >=20 > On 2019/03/23 2:36, Thibaut Madelaine wrote: > > I tested your last patch and if I didn't mix up patches on the end = of > > a too long week, I get a problem when querying the sub-sub = partition: > > > > test=3D# explain select * from test2_0_10 where id =3D 25; > > QUERY PLAN > > ------------------------------------------------------------ > > Seq Scan on test2_0_10 (cost=3D0.00..25.88 rows=3D6 width=3D36) > > Filter: (id =3D 25) > > (2 rows) >=20 > The problem here is not really related to partition pruning, but = another problem I recently sent an > email about: >=20 > = https://www.postgresql.org/message-id/9813f079-f16b-61c8-9ab7-4363cab28d8= 0%40lab.ntt.co.jp >=20 > The problem in this case is that *constraint exclusion* is not = working, because partition constraint > is not loaded by the planner. Note that pruning is only used if a = query specifies the parent table, > not a partition. Thanks for the comments. I saw that email. Also, I checked that query Thibaut mentioned worked correctly with Amit's patch discussed in that thread. Best regards, Yuzuko Hosoya