Also, it's not required, but I think a typical partitioning schema would havean index on the column being partitioned. I see you have an index oniot_data(metadata,lower(data)), so I still wonder whether you'd have betterresults partitioned on metadata, or otherwise maybe adding an index on"device". But I don't know what your typical queries are.
I understood now why u suggested an index on the partition column. It depends on how many distinct values of the partition column I'll have in that partition.
Thanks for the suggestion , good idea !