Shlink version
4.1.0
PHP version
8.x
How do you serve Shlink
Docker image
Database engine
MySQL
Database version
8.x
Current behavior
The recently introduced DeleteExpiredShortUrlsCommand to clean up expired links is great, as we foresee our database to grow in the millions over time. However, as there is no index on the expiry date column, this command will become increasingly heavy as it has to go over every single record.
Expected behavior
An index on the expiry date column will drastically increase the speed of the DeleteExpiredShortUrlsCommand
Minimum steps to reproduce
Fill up the database with a couple of thousand/million links.
Run the DeleteExpiredShortUrlsCommand
Now add the index and compare the performance of the DeleteExpiredShortUrlsCommand