MySQL shared table or table in each database
I have such a situation, in my system there are many databases and for some queries I need to use the same table "hours", which basically has one field 'h' and stores hours like '00',...,'23'.
My question is about efficiency, is it better to create separate database and store this table there or have this table in each database. My queries will look like:
SELECT ... FROM hours CROSS JOIN some_table ...
Either way, you'd be having to modify all the "non-local" queries to use that table
SELECT ... FROM sometable CROSS JOIN dbname.hours
If it's stuck into its own database, then you have to modify ALL queries. If it's in one of the 'real' databases, you only have to modify n-1 queries. Plus having to grant appropriate permissions on that table if you're using multiple different mysql accounts for the different databases.