X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 88775D1CCDB for ; Tue, 27 Jan 2004 19:30:01 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 20513-07 for ; Tue, 27 Jan 2004 15:29:30 -0400 (AST) Received: from morework.geizhals.at (home.geizhals.at [213.229.14.34]) by svr1.postgresql.org (Postfix) with ESMTP id 55DCAD1D202 for ; Tue, 27 Jan 2004 15:29:30 -0400 (AST) Received: from localhost (morework [127.0.0.1]) by morework.geizhals.at (Postfix) with ESMTP id 5497852403C for ; Tue, 27 Jan 2004 20:29:13 +0100 (CET) Received: from morework.geizhals.at ([127.0.0.1]) by localhost (morework [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 05140-04 for ; Tue, 27 Jan 2004 20:29:13 +0100 (CET) Received: from geizhals.at (unknown [10.0.0.33]) by morework.geizhals.at (Postfix) with ESMTP id 1AFF152402B for ; Tue, 27 Jan 2004 20:29:13 +0100 (CET) Message-ID: <4016BB4E.7030107@geizhals.at> Date: Tue, 27 Jan 2004 20:26:06 +0100 From: "Marinos J. Yannikos" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031204 Thunderbird/0.4RC2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: (partial?) indexes, LIKE and NULL Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p5 at geizhals.at X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/283 X-Sequence-Number: 5457 Hi, with the following table: Table "public.foo" Column | Type | Modifiers --------+------+----------- t | text | Indexes: "a" btree (t) Shouldn't queries that use ... where t like '%something%' benefit from "a" when t is NULL in almost all cases, since the query planner could use "a" to access the few non-NULL rows quickly? It doesn't seem to work right now. (I assume that it would make no difference if the index "a" was partial, excluding NULLs) Regards, -mjy