I have a configuration that harvest files from CCK fields. In the end, I get more than 50K files.

The harvesting query is quite slow in this case, but can be sped up just by adding a few indexes.

Here is a patch for this.

Comments

bcmiller0’s picture

this makes sense and we were seeing simular results. I also added one for process_file based on this other patch on drupal.org/node/712998

for the function can use either harvest_file or process_file for the select.

arthurf’s picture

Thanks for the patches. Applied to the 6.1.x branch and adapted to 6.2.x

arthurf’s picture

Status: Active » Needs review
osopolar’s picture

@arthuff: You fixed the 6.x.2.x-dev schema, but you did NOT provide an update_N hook. Although it's a dev and the use is on everybody's own risk you should provide update_n hooks, otherwise we will have inconsistent database versions. I'm going to use this version to build a production site. I know that I'll have to test more but I thought it is OK, now I am in doubt if this would be a good idea.

I see, that there is no update path from 6.x.1.x to 6.x.2.x, for that it might be just ok to leave a message on the modules page. Although, why not provide the update functions now, and do it step by step. Later you will loose track and it makes things more complicate.

osopolar’s picture

StatusFileSize
new5.06 KB

* FIX keyname should be 'cid_fid' (not 'cid,fid'), this was not valid and therefore the table media_mover_files could not be created.
* ADD 'not null' => TRUE, 'unsigned' => TRUE to serial fields, as described in http://drupal.org/node/146939 (All fields listed in the primary key must have 'not null' => TRUE in their specification).
* ADD update function media_mover_api_update_6201: Add more indexes to table media_mover_files for better performance.
* CHANGE mmfid is already an index because its a primary key (and does not need to be declared as index again).
* CHANGE consistent code formatting.