I have the following problem:
I have measuring devices, each one measure always the same quantities from the list of five different ones. Each device can measure different quantities from this list. I update the data only sometimes (once a month), but read them online based on time frames (no caching on app side). Every device has aproximatelly 20K entries up to date. New device will be added only in special cases, so devices can be seen as fixed.
My question is:
Should I have one big table or multiple (hunderds) of small ones.
Advantages / Disadvantages I see:
Single table
-) waste of space, since some columns are not filled, because device not measure certain quantity
+) safer select - device ID is not part of table name and can be passed safely with PDO or other library to prevent injections
+) easier to select multiple devices at once (however, this is not an usuall user case)
Multiple tables
+) "space" friendly
-) more complicated select - table name must be checked manually (from schema table) before select to prevent injections