D
D
domanskiy2020-09-08 16:02:59
MySQL
domanskiy, 2020-09-08 16:02:59

How to insert a variable number of tables into a MySQL table?

There is an order. The order has a certain set of fields: ORDER_ID, Date_created, costumer, etc.,
but the order comes with tables (with approximately the following fields in each: TABLE_ID, ROW_ID, URL_FILE, ANGLE)
An order can have from 1 to N tables
Number of rows in each table from 1 to N
I think it's worth creating a separate FRAMES table for these tables, and linking its rows with orders. Those. each row will contain two fields ORDER_ID and TABLE_ID - as an indicator to which table the ROW_ID row belongs and to which order ORDER_ID.
OTM communication
The volume of the order database is approximately 1,000 orders per year, each with an average of 5 tables. Each table has an average of 20 rows.
Those. 100,000 rows will be added to the table per year.
Maybe you should do a backup? Those. a separate table or database into which all orders and related tables for the past year will be dumped.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lazy @BojackHorseman MySQL, 2020-09-08
@domanskiy

right.
about "archiving" you will think when the speed of selections on indexes ceases to satisfy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question