Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 8280F475876 for ; Wed, 24 Jul 2002 14:06:36 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.5/8.12.5) with ESMTP id g6OI6YVk012705; Wed, 24 Jul 2002 14:06:34 -0400 (EDT) To: "Marc Mitchell" Cc: pgsql-admin@postgresql.org Subject: Re: Postgres performance slowly gets worse over a month In-reply-to: <001301c2333c$8343ace0$3c0aa8c0@nmtransfer.com> References: <4.2.2.20020723110231.01daf8c0@ecint.ecinet.com> <1027448992.25561.25.camel@skymaster> <015d01c23281$2ce57380$6f01050a@eisolution.com> <11612.1027524101@sss.pgh.pa.us> <001301c2333c$8343ace0$3c0aa8c0@nmtransfer.com> Comments: In-reply-to "Marc Mitchell" message dated "Wed, 24 Jul 2002 13:04:05 -0500" Date: Wed, 24 Jul 2002 14:06:33 -0400 Message-ID: <12704.1027533993@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200207/346 X-Sequence-Number: 5030 "Marc Mitchell" 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