Skip to content
Snippets Groups Projects
  • Robin Appelman's avatar
    861fbd06
    add a prefix index to filecache.path · 861fbd06
    Robin Appelman authored
    
    The reason that `filecache.path` hasn't had an index added is the mysql limitation of ~1kb for indexeded fields,
    which is to small for the `path`, however mysql supports indexing only the first N bytes of a column instead of the entire column,
    allowing us to add an index even if the column is to long.
    
    Because the index doesn't cover the entire column it can't be used in all situations where a normal index would be used, but it does cover the `path like 'folder/path/%'` queries that are used in various places.
    
    Sqlite and Postgresql don't support prefix indexes, but they also don't have the 1kb limit and DBAL handles the differences in index creation.
    
    Signed-off-by: default avatarRobin Appelman <robin@icewind.nl>
    861fbd06
    History
    add a prefix index to filecache.path
    Robin Appelman authored
    
    The reason that `filecache.path` hasn't had an index added is the mysql limitation of ~1kb for indexeded fields,
    which is to small for the `path`, however mysql supports indexing only the first N bytes of a column instead of the entire column,
    allowing us to add an index even if the column is to long.
    
    Because the index doesn't cover the entire column it can't be used in all situations where a normal index would be used, but it does cover the `path like 'folder/path/%'` queries that are used in various places.
    
    Sqlite and Postgresql don't support prefix indexes, but they also don't have the 1kb limit and DBAL handles the differences in index creation.
    
    Signed-off-by: default avatarRobin Appelman <robin@icewind.nl>