Karsten Hilbert wrote:
> > I guess you know where it ends--the index is not used for IS [NOT] NULL
> > expressions. The obvious workaround was to add DEFAULT value to
> > "processed" in form of kind of anchor (we used '-infinity')
>
> Wouldn't it have worked to add an index
>
> ... WHERE processed IS NULL
>
> and go from there ?
Yes, you use a partial index. The 8.0beta1 docs mention this:
Indexes are not used for <literal>IS NULL</> clauses by default.
The best way to use indexes in such cases is to create a partial index
using an <literal>IS NULL</> comparison.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073