@FabioA35 good morning, without knowing all the details for this requirement I can imagine mainly 2 options:
The first one as you said would be to run a SQL Query agains these tables directly in the DB.
The second one would be to create a JS that takes a number of records(1000 each time for example) and deleted them.
Based on my experience, I would say the SQL Query would be better in terms of performance(directly executed in the DB), but you will not be able (if required) to report on those records you are deleting.
If you have a need to report on those records in the future, I would create a JS that process records(retrieved by a Report Definition for example) periodically and via an activity remove those record and store some information in a separate Data Type for example.