> A temp table is never vacuumed or analyzed by autovacuum, so unless you
> do so using explicit commands it will have default "magic numbers" statistics.
> You are likely to get a better plan if you run ANALYZE (or perhaps VACUUM
> ANALYZE) on the temp table after you load data and before you use it in a query.
Thanks for the tip. Unfortunately, while testing, this doesn't seem to make any difference, not even when using
non-temporarytables (with ANALYZE/VACUUM). Still more than 10 seconds for the fetch, 1-2 for the count. It seems, the
problemis simply that the fact that we are talking about more than 100MB an data that needs to be fetched.
Regards,
Flo