I have a problem.
I have one master table of urls. The UrlId is primary key. Starting from 10000. In this table i have all urls addresses i have found. Then i have 1000 tables in a different database (so i cannot use foreign keys). They are all identical to eachother like urldata.100 up to urldata.999. (Here i store meta data etc)
Suppose i want to use the left function in a join to join each master record for instance
Id 10000 – joins to table urldata.100
Id 11034 – joins to table urldata.110
So i wanna take out the first 3 numbers from each UrlId from the master table in a massive join.
Can this be achieved?
This is a REALLY REALLY bad design, as it restricts both scalability, as well as the performance of the database.
If you really want to store your meta data for different
UrlIds, you just need to create one table. Call itUrlMeta, or something similar.The structure would be
(UrlID, MetaName, MetaValue). This structure can store as much meta data as you want as(MetaName, MetaValue)pairs.After you manage this, your queries would become extremely simple, as you only need to join 2 tables, instead of 1001!