Did you try to transform your temp table into a table partition using the ALTER TABLE ATTACH syntax https://www.postgresql.org/docs/10/static/ddl-partitioning.html Regards PAscal -- Sent from: http://www.postgresql-archive.org/PostgreSQL-performance-f2050081.html