Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 247CB9F9FB2 for ; Sat, 16 Dec 2006 16:34:58 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 91193-01 for ; Sat, 16 Dec 2006 16:34:46 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id A9FDD9F9357 for ; Sat, 16 Dec 2006 16:34:48 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id kBGKYfRD007745; Sat, 16 Dec 2006 15:34:41 -0500 (EST) To: Ireneusz Pluta cc: jamcito , pgsql-performance@postgresql.org Subject: Re: partition text/varchar check problem In-reply-to: <4584540D.2080208@wp.pl> References: <458402D4.7080500@poczta.fm> <4584540D.2080208@wp.pl> Comments: In-reply-to Ireneusz Pluta message dated "Sat, 16 Dec 2006 21:16:13 +0100" Date: Sat, 16 Dec 2006 15:34:41 -0500 Message-ID: <7744.1166301281@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/446 X-Sequence-Number: 22502 Ireneusz Pluta writes: > Can you show what you get from: > EXPLAIN SELECT * FROM data WHERE name LIKE 'a%' Won't help. Exact equality of the WHERE condition is useful for partial-index cases, because there the planner needs to prove that the WHERE condition implies the index predicate before it can use the index; and exact equality is certainly sufficient for that. But for constraint exclusion, the problem is to prove that the WHERE condition refutes the constraint, rather than implies it. Knowing that "name LIKE 'a%'" disproves "name LIKE 'b%'" requires more knowledge about LIKE than the planner has got. regards, tom lane