perf: Add prefix index for file_url (#29185)
Currently it's full table scan, that too on a TEXT field filter. It's used for finding file docs when `fid` isn't specified. No idea where we are STILL having private file URLs without fids. In any case, this is still required.
This commit is contained in:
parent
638b118875
commit
5874d6bf12
2 changed files with 2 additions and 1 deletions
|
|
@ -190,7 +190,7 @@
|
|||
"icon": "fa fa-file",
|
||||
"idx": 1,
|
||||
"links": [],
|
||||
"modified": "2024-05-09 11:46:42.917146",
|
||||
"modified": "2025-01-15 11:46:42.917146",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Core",
|
||||
"name": "File",
|
||||
|
|
|
|||
|
|
@ -797,6 +797,7 @@ class File(Document):
|
|||
|
||||
def on_doctype_update():
|
||||
frappe.db.add_index("File", ["attached_to_doctype", "attached_to_name"])
|
||||
frappe.db.add_index("File", ["file_url(100)"])
|
||||
|
||||
|
||||
def has_permission(doc, ptype=None, user=None, debug=False):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue