Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Improve general performance around short URLs for instances with a large number #2112

@marijnvandevoorde

Description

@marijnvandevoorde

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions