BACKGROUND I have a table that contains event tickets for about 4,000 events.
Currently, the table is about 3 million rows. Roughly every five minutes, the inventory for an event changes (which I retrieve externally), and I DELETE the tickets for the event AND INSERT the new inventory.
These DELETE and INSERT statements are not executed in regular intervals -- there may be 5 or 6 of them within 30 seconds.
I have two indexes on the table. Every SELECT statement on the table starts with WHERE event_id='myevent' (I never need to query across events).
QUESTIONS
- Should each event have its own table?
- Will it be obviously more efficient and faster to DELETE and INSERT out of separate tables so that these statements can run in parallel for different events, as opposed to in "series"?
IRRATIONAL FEAR? The thought of "managing" what will become 10,000+ tables is intimidating.
The time and cost of changing the database structure is minimal, so I ultimately want to do the best thing -- whatever that is.
Your advice is appreciated.