"Jim C. Nasby" <jnasby@xxxxxxxxxxxxx> writes: > On Wed, Jan 11, 2006 at 09:39:47PM +0100, Andrea Arcangeli wrote: >> The index only helps the above query with = 0 and not the one with != 0, >> but it seems not needed in practice. > I suspect this is because of a lack of stats for functional indexes. No, it's because != isn't an indexable operator. regards, tom lane