Re: Slow update of indexed column with many nulls - Mailing list pgsql-performance

From Josh Berkus
Subject Re: Slow update of indexed column with many nulls
Date
Msg-id 200303231355.02826.josh@agliodbs.com
Whole thread Raw
In response to Slow update of indexed column with many nulls  (bsamwel@xs4all.nl)
List pgsql-performance
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


pgsql-performance by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Adding a foreign key constraint is extremely slow
Next
From: Oleg Lebedev
Date:
Subject: Slow query