Re: Postgres performance slowly gets worse over a month - Mailing list pgsql-admin

From Tom Lane
Subject Re: Postgres performance slowly gets worse over a month
Date
Msg-id 12704.1027533993@sss.pgh.pa.us
Whole thread Raw
In response to Re: Postgres performance slowly gets worse over a month  ("Marc Mitchell" <marcm@eisolution.com>)
List pgsql-admin
"Marc Mitchell" <marcm@eisolution.com> writes:
> 1) Is there any inherit value or "dis-value" to using a partial index in
> this case?  Given that 50% of the table has a value the we have no need to
> be supported via an index, is there any reason not to use a partial index?

It probably would be a win, just on the basis of reducing the size and
amount of update activity for the index.

> 2) If we stay in 7.1, would changing the foriegn key field from "NOT NULL"
> (where we currently populate with zero) to nullable (where we would
> populate instead with null) have any effect on performace?  The hope would
> be that nulls might be treated differently within the 7.1 stats gathering
> process than non-null values.

In fact they are, and this very likely would be a cleaner solution
anyway.  Seems like NULL might be a semantically clearer representation
of the row's status than zero.  You could still do something with a
partial index excluding the nulls in 7.2, I think.

            regards, tom lane

pgsql-admin by date:

Previous
From: "Marc Mitchell"
Date:
Subject: Re: Postgres performance slowly gets worse over a month
Next
From: "Chad R. Larson"
Date:
Subject: Re: Postgres performance slowly gets worse over a month