I have a TABLE called "Data" which I filled with information brought from a CSV file (Generated from a third-party system).
the database has multiple columns with Codes that are not numeric. This is just a small example
Table Data Easily exceeded 250,000 records per month
as " Solution " I had thought about dividing the data table into several tables. that is customers, routes, products
and fill these tables from mysql queries such as
insert into productos(producto_codigo,producto)
select producto_codigo,producto from datos
this also adding a numeric id to each table to achieve a result like this
after this insert the auto numeric key in the "Data" table with the following query
UPDATE datos as d,productos as p
SET d.productoid = p.id
where d.codigo_producto = p.codigo_producto
which worked for a while. over time the querys took longer and longer. obviously I'm doing it wrong
for you what would be the right way to do it? How do I make this optimal?
taking into account that the CSV file is the only possible way to migrate data due to business problems with the third party company