pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: bsamwel@xs4all.nl
To: pgsql-performance@postgresql.org
Subject: Re: Slow update of indexed column with many nulls
Date: Sun, 23 Mar 2003 13:55:02 -0800
Message-ID: <200303231355.02826.josh@agliodbs.com> (raw)
In-Reply-To: <21139.194.109.187.67.1048441138.squirrel@webmail.xs4all.nl>
References: <21139.194.109.187.67.1048441138.squirrel@webmail.xs4all.nl>

Bart,

> insert into foo (baz) values (28);
> create index foo_idx on foo(baz);
> vacuum full analyze foo;
>
> Now, we would expect that PostgreSQL is fully aware that there are not
> many rows in foo that have "baz is not null". However:

This is a known issue discussed several times on this list.   Try re-creating 
your index as:

create index foo_idx on foo(baz) where foo is not null;

See the list archives for the reasons why.  This may improve in future 
releases of PostgreSQL.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco




view thread (2+ messages)

Message-ID: <200303231355.02826.josh@agliodbs.com>
Permalink:  ../200303231355.02826.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200303231355.02826.josh@agliodbs.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: josh@agliodbs.com, bsamwel@xs4all.nl
  Subject: Re: Slow update of indexed column with many nulls
  In-Reply-To: <200303231355.02826.josh@agliodbs.com>
  References: <21139.194.109.187.67.1048441138.squirrel@webmail.xs4all.nl> <200303231355.02826.josh@agliodbs.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