I'm working on a project using database as MySql
where some areas will be constantly fed generating a large number of records in a short time, as is the case of an area for maintenance tickets. However, this data becomes obsolete as quickly as it is created, and after a certain time, it no longer needs to be used.
How can I mount a system to "Archive" these records so that it no longer 'weighs' in the table?
I currently have a related table structure, where I relate clients and moderators to Ticket. Example:
tabela: Cliente
id | nome_cliente | sobrenome_cliente | etc..
tabela: Moderador
id | nome_moderador | cargo | etc..
tabela: Ticket
id | id_cliente | id_moderador | id_assunto | etc..
I could just create a new column arquivado
in the Ticket
table and use a SQL
to select all but the archived. But they would still be registered in that table.
Creating a new duplicate table from the Ticket table would be the solution? Eg: ticket_arquivos
and then move records to it?
Or what other method can I use to do this management?
Another doubt about this would be regarding the identification of this obsolete data. I currently have the column status
and data_update
, where the status should be terminated and the current date should be greater than 15 days from the update date. Is it possible to make this data_update
column automatically refresh regardless of the type of sql
that it suffers? Be a UPDATE
or a SELECT
?