I have a database design question. We have a database that holds delivery orders. Each order is associated with a company who is providing the delivery. So each order has an associated delivery company name, and recipient phone number and recipient address. The add and edit forms have a text input field for the address, that uses ajax to query the existing addresses in the database based on the phone number entered, for autocomplete in a datalist associated with that text input field.
The Orders table will be huge. The concern is that the query of the database that gets the existing addresses from the Orders table with each key press will get too slow. It has been suggested that I create a separate table for every company, in addition to the main Companies table and Orders table, that contains only the phone numbers and addresses that pertain to that company, so that the query becomes manageable and fast.
We expect to have 15,000 customers, so this will mean a few main tables, and then 15,000 separate tables that contain phone numbers and addresses that pertain only to each company.
Is this a good idea? 15,000 tables sounds odd to me, but maybe it is good. If not, what is the best way to handle this? Partitions of sorts?