Skip to content

Performance issue when ordering Media

It seems some Media table indexes are not used when ordering the results, which is likely to cause noticeable slowdowns when fetching large amount of media, such as all the album tracks.

This is likely related to https://forum.videolan.org/viewtopic.php?f=35&t=158486&p=522057#p522057

All these orderings are causing a temporary B-tree to be created (SCAN TABLE Media then USE TEMP B-TREE FOR ORDER BY) instead of a scan table based on index (SCAN TABLE Media USING INDEX media_***_idx when using EXPLAIN QUERY PLAN):

  • duration
  • insertion_date
  • release_date
  • play_count
  • filename
  • title
Edited by Hugo Beauzée-Luyssen
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information