Kenneth Marshall <ktm(at)rice(dot)edu> writes:
> We have just upgraded our monitoring server software and
> now the following query for graphing the data performs
> abysmally with the default settings. Here is the results
> of the EXPLAIN ANALYZE run with nestloops enabled:
That plan seems a bit wacko --- I don't see a reason for it to be using
an indexscan on items ii. Can you extract a self-contained test case?
regards, tom lane