MySQL – Table and Database Design Question

database-designMySQLshardingtable

Suppose you have these fields to keep track of in records: (first_name, last_name, state_id, stateid_status, day, month, year, id_status, id, criminal_status, charge, plea, sentence, create_time, update_time, hashID). If you were designing the database/table(s), would you create a single table, or would you divide the fields over multiple tables?

Why?

P.S. stateid_status, criminal_status, and id_status refer to the existence of those elements (e.g., criminal history either does or doesn't exist, the entity either does or doesn't have a state ID, etc.)

Best Answer

It's better to extract some rarely used fields to another table. Especially if those fields are big (blob, long varchar etc). This will case smaller row size and better optimized buffer usage. Because small data (i.e 'id', 'name', 'status') will be stored in buffer and will have fast access to it. And queries with big fields (i.e. 'description TEXT') will be slower, because of need to read second table which can be unbuffered yet.

So, I think in your case there is no reason to split fields into different tables.