MySQL Forums
Forum List  »  General

Re: need help with tables/fields layout.
Posted by: Rick James
Date: April 23, 2009 11:19PM

I would not want to have more than, say, 10K tables. Various limits (including OS limits) might be hit.

The one-table approach could need messy self-joins to extract data.

Ponder this approach...
1. What will your SELECTs look like?
2. What indexes would be needed to support them?
3. What is the minimal set of table(s) and index(es) to SELECT just the indexed fields?
4. Which table(s) should get the rest of the 'columns'. I'm guessing (but can't really tell) that this last step is where your 'variable column' structure gets messy. Well, don't put them in columns. Instead,
5. Put the rest of the fields into a PHP associative array, then use json_encode on the array, and toss it into a single TEXT field that lives in the table(s).

Confused? Well, at least tell us about step 1.

Options: ReplyQuote


Subject
Written By
Posted
Re: need help with tables/fields layout.
April 23, 2009 11:19PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.