MySQL – Duplicate Same Table for Multiple Locations

database-designMySQLperformance

We have an "appointments" table with following schema.

appointments(app_id,.....,app_type,location_id)

app_type – type of appointment
location_id – keeping the location for multiple location setup.

We are using MySQL and expect about 20,000-50,000 rows inserted per day around 365 days.

The expected number of operations = number of appointments * 5

For each operation in our app, we'll read this appointment table to get particular appointment details and update certain flags in the same table.

SPEED is our main concern.
My question is, performance wise is it OK to

  1. leave this schema as it is (large number of rows and many reads across it), or
  2. keep separate appointments tables for locations?

Best Answer

You are talking about less than 5 queries per second. A well maintained database can handle 100 qps or more.

A poorly handled db will melt down even with 5 qps.

It is rarely a good idea to split a table artificially.

It is usually a good idea to normalize repeated data. But don't normalize 'continuous' data, such as numbers, dates, floats, etc.

What will the SELECTs look like? And SHOW CREATE TABLE. Then we can discuss what indexes to have, and whether you have under/over-normalized, etc.