My problem is my MySQL database/table design. Let's assume the following:
- The database must be designed for 65 000 employees.
- Each employee has roughly about 1000 fields (columns).
- 900 of the 1000 fields are of type "float(16,2)" (Salary, Tax deduction etc)
- 50 of the 1000 fields are of type "date" (Date of Birth, Date Joined etc)
- 50 of the 1000 fields are of type "char" (Surname, Inits, Address etc)
I now sit with the following design options:
A) One massive table 65 000 rows and 1000 columns where employee number is the unique primary key
OR
😎 3 tables with 65 000 000 rows and and 4 columns each
col1 = auto-increment which is the unique primary key,
col2 = employee number, (in other words about 1000 per employee)
col3 = value description, (a field to identify what col4 is eg."Date of Birth"),
col4 = actual value (amount or date or char)...
OR
C) splitting the massive table into say 3 tables:
- table 1: (dates) 65 000 rows, 51 cols where col 1 is employee number (unique, primary) and the remaining 50 the actual dates
- table 2: (text) 65 000 rows, 51 cols where col 1 is employee number (unique, primary) and the remaining 50 the actual strings (surname, inits, address etc)
- table 3: (amounts) 65 000 rows and 901 cols where col 1 is employee number (unique, primary) and the remaining 900 the actual amounts
OR
D) Same as C, but splitting table 3 into say 5 tables.
Which of these would be the best design with the fastest access? I like option 😎, just worried about the (900*65 000) 58 500 000 rows...
Any comments? Somebody please advise or refer me to a place where I can get help...!
Thanks very much