Karl Wright <kwright@xxxxxxxxxxxxx> writes: > I did an ANALYZE on that table and repeated the explain, and got this: > ... > ... even more wildly wrong. Hmm. You might need to increase the statistics target for your larger tables. It's probably not a big deal for queries like this one, but I'm worried that you may be getting bad plans for complicated joins. regards, tom lane