IT notes

Delete in chunks

To delete a big/huge table in chunks, you could create this store procedure, but the performance at the end depends of how good/normalized is your database (indexes): A stored procedure is a prepared SQL code that you can save, so the code can be reused over and over again. Such procedures are stored in the database data dictionary. Connect to the database and select the database: mysql> \u my_database Database changed To list stored procedures

ELK delete_by_query

To delete indexes older than X days: POST haproxy/_delete_by_query { "query": { "range": { "ISODATE": { "lt": "now-3d" } } } }