I'm developing a web application where PostGIS will be used as a vector tile server backend to serve mvt tiles. For each user of the application at least one vector layer will be created. So, potentially there are going to be thousands of layers. Since these layers will be used to serve tiles, read-queries performance is rather critical. My question is, whether I should store all geometries in a
feature table with a foreign key referencing
layer table, or should I have a separate table for each layer, eg.
The second approach feels more natural and common for relational databases. However, I have arranged a little experiment, importing 5000 layers to a single table and saw that there is a significant fall in performance.
What is the general approach to this problem? Searched the web but couldn't find the answer.