Download & Extend

Optimize CCK harvesting by adding index to media_mover_files table

Project:Media Mover
Version:6.x-1.0-beta9
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

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.

AttachmentSize
media_mover_api-optimize-cck-harvest.patch1 KB

Comments

#1

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.

AttachmentSize
media_mover_api-optimize-cck-harvest-1127970-2.patch 1.18 KB

#2

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

#3

Status:active» needs review

#4

@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.

#5

* 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.

AttachmentSize
media_mover-install-1127970-5.patch 5.06 KB
nobody click here