Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I noticed a query showing up on my server as unindexed. It seems that the uc_file module commonly queries the uc_files table filtering on the unindexed filename field. The attached patch indexes this field to lighten that query.
Comment | File | Size | Author |
---|---|---|---|
uc_file.index_filename.patch | 928 bytes | neclimdul | |
Comments
Comment #1
neclimdulSimple fix still applies. By commonly queried, there are quite a few queries that call this that happen on a good number of admin pages(auto complete, file listing, etc) and the user edit form. For a large number of files this can be a pretty good sized unindexed scan or sort.
Comment #2
longwaveChanging component.
Comment #3
longwaveIn testing this cut the runtime of uc_file_refresh() on a large folder by about 60% so it makes sense to me. Committed to 6.x.
Comment #4
longwavePorted and committed to 7.x.
Comment #5
TR CreditAttribution: TR commentedD6 patch generates PHP Warning in PHP 5.2.13: "Warning: Call-time pass-by-reference has been deprecated in /xxx/sites/all/modules/ubercart/uc_file/uc_file.install on line 445"
Line 445 is
db_add_index(&$ret, 'uc_files', 'filename', array('filename'));
Comment #6
longwaveComment #7
longwaveFixed by removing the &