Skip to content

add file_name index to exp_files table #5044

@jcogs-design

Description

@jcogs-design

On a site with very many files (many tens of thousands) noticed that a model call

$file = ee('Model')->get('File')->filter('file_name', $file_basename)->first();

was running unexpectedly slowly.

Upon investigation it turns out exp_files is only indexed on the upload_location_id and site_id

Have added some work-around code to compensate, but seems likely that many people will want to search for files by file_name ... so maybe would be helpful if this column was also indexed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions