> PostgreSQL does not have, and has never had a query cache - so nothing
> you do is going to make that second query faster.
Let me clarify that. PostgreSQL will of course cache the disk pages
used in getting the data for your query, which is why the second time
you run it, it is 3 seconds faster.
However, it does not cache the _results_ of the query. Each time you
run it, it will be fully re-evaluated.
The btree error you give is bad and I'm sure the more experienced list
members will want you to dig into it for them.
Chris