> Have you tried getting a profile of what exactly PostgreSQL is doing
> that takes so long when creating a temp table?
Nope, I'm not proficient in the use of these tools (I stopped using C
some time ago).
> BTW, I suspect catalogs might be the answer,
Probably, because :
- Temp tables don't use fsync (I hope)- Catalogs do- fsync=off makes COMMIT fast- fsync=on makes COMMIT slow- fsync=on
andusing ANALYZE makes COMMIT slower (more updates to the
catalogs I guess)
> which is why Oracle has you
> define a temp table once (which does all the work of putting it in the
> catalog) and then you just use it accordingly in each individual
> session.
Interesting (except for the ANALYZE bit...)