Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eH0Tl-0001UH-Cu for pgsql-general@arkaria.postgresql.org; Tue, 21 Nov 2017 04:48:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eH0Tk-0001Vz-Ar for pgsql-general@arkaria.postgresql.org; Tue, 21 Nov 2017 04:48:12 +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 1eGux7-0003zb-1A for pgsql-general@lists.postgresql.org; Mon, 20 Nov 2017 22:54:09 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eGux2-0007XX-As for pgsql-general@postgresql.org; Mon, 20 Nov 2017 22:54:07 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id BED2F98B5473 for ; Mon, 20 Nov 2017 15:54:02 -0700 (MST) Date: Mon, 20 Nov 2017 15:54:02 -0700 (MST) From: legrand legrand To: pgsql-general@postgresql.org Message-ID: <1511218442722-0.post@n3.nabble.com> Subject: One Partition by list is always chosen by planner MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, after creating a table wiki_data_part with partition by list (category); and creating partitions like CREATE TABLE wiki_data_part_a PARTITION OF wiki_data_part FOR VALUES IN ('ang.q',...,'arc'); CREATE TABLE wiki_data_part_b PARTITION OF wiki_data_part FOR VALUES IN ('bs.s',...,'bg.n'); copy table wiki_data_part from ...; analyze wiki_data_part; explain select * from wiki_data_part where category='en' | Append (cost=0.00..21595.75 rows=4 width=102) | -> Seq Scan on wiki_data_part_e (cost=0.00..21578.00 rows=1 width=102) | Filter: ((category)::text = 'en'::text) | -> Seq Scan on wiki_data_part_s (cost=0.00..17.75 rows=3 width=102) | Filter: ((category)::text = 'en'::text) partition wiki_data_part_s (that has more than 100 values in its list) is always scanned, even when where predicates are not in its values list ... Problem occurs on PostgreSQL 10.0, compiled by Visual C++ build 1800, 64-bit even without data loaded. If this is a problem of max values, maybe this could be added in doc ? wiki_data_wrong_part_s_chosen.sql -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html