pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PC Drew <drewpc@ibsncentral.com>
To: Marinos J. Yannikos <mjy@geizhals.at>
To: pgsql-performance@postgresql.org
Subject: Re: (partial?) indexes, LIKE and NULL
Date: Tue, 27 Jan 2004 12:51:56 -0700
Message-ID: <82CEDAA6A559DB48A373FC3090F2560F35668F@mail.ibsncentral.com> (raw)

My understanding is that having NULL values in an index breaks it completely.  Meaning it won't be used in any query planning.  Maybe I'm wrong though...


-----Original Message-----
From:	Marinos J. Yannikos [mailto:mjy@geizhals.at]
Sent:	Tue 1/27/2004 12:26 PM
To:	pgsql-performance@postgresql.org
Cc:	
Subject:	[PERFORM] (partial?) indexes, LIKE and NULL

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


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend





view thread (3+ messages)  latest in thread

Message-ID: <82CEDAA6A559DB48A373FC3090F2560F35668F@mail.ibsncentral.com>
Permalink:  ../82CEDAA6A559DB48A373FC3090F2560F35668F@mail.ibsncentral.com/
Also on:    postgresql.org/message-id/82CEDAA6A559DB48A373FC3090F2560F35668F@mail.ibsncentral.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: drewpc@ibsncentral.com, mjy@geizhals.at
  Subject: Re: (partial?) indexes, LIKE and NULL
  In-Reply-To: <82CEDAA6A559DB48A373FC3090F2560F35668F@mail.ibsncentral.com>
  References: <82CEDAA6A559DB48A373FC3090F2560F35668F@mail.ibsncentral.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox