Michael Glaesemann <grzm(at)seespotcode(dot)net> writes:
> Off the cuff, when was the last time you vacuumed or ran ANALYZE?
> Your row estimates look off by a couple orders of magnitude. With up-
> to-date statistics the planner might do a better job.
>
> As for any other improvements, I'll leave that to those that know
> more than I. :)
>
> Michael Glaesemann
> grzm seespotcode net
The script that imports data into these tables runs a vacuum analyze at
the end so there has been no new data added to the tables since the last
time vacuum analyze was run.