Did you try to transform your temp table into a table partition using theALTER TABLE ATTACH syntaxhttps://www.postgresql.org/docs/10/static/ddl-partitioning.html
RegardsPAscal
--Sent from: http://www.postgresql-archive.org/PostgreSQL-performance-f2050081.html