Skybrud.Umbraco.Redirects icon indicating copy to clipboard operation
Skybrud.Umbraco.Redirects copied to clipboard

Add database indexes

Open ronaldbarendse opened this issue 5 years ago • 2 comments

The SkybrudRedirects table should get some database indexes, as retrieving rows currently scans the whole table and that can take quite some time, especially when a lot of redirects are added...

The built-in Umbraco umbracoRedirectsUrl table indexes a hash of the URL, together with the resulting content/node key, culture and creation date. This ensures the index isn't unneccesary large and sorting on most recently added redirect can also be done efficiently within the database.

ronaldbarendse avatar Nov 12 '19 13:11 ronaldbarendse

@ronaldbarendse thanks for creating this issue. It may not make as much sense if a cache layer is introduced, but I'll keep it in mind 👍

abjerner avatar Nov 28 '19 22:11 abjerner

Caching won't make it faster, as it still needs to get the data from the database. Loading all redirects into the cache also isn't efficient (especially with large amounts of redirects) and an anti-pattern, as you should only cache frequently used objects.

ronaldbarendse avatar Nov 29 '19 08:11 ronaldbarendse