| Project: | Corresponding node references |
| Version: | 6.x-4.1 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
I have about 18,000 nodes that have incomplete references and need to be updated by CNR. I went to CNR's "update existing nodes" page and selected my content type that has 18,000 nodes, left the default batch size of 50 and then clicked "Submit". I clicked "Submit" about 16 hours ago and it still isn't done yet, it's at 16,000 out of 18,000. I have another content type that has 240,000 nodes that need to be updated by CNR and I can't imagine how long that is going to take.
I'm running XAMPP on a recently purchased (in the last year) Mac Pro tower, so it's probably not the hardware that's the problem. Is there anywhere in the code that might be causing CNR to be so slow for large numbers of nodes?
Comments
#1
On the other way, When I delete nodes which have both ways of node reference setup with other type of nodes. Deleting process take a lot of time. 4000 nodes, one hour finish 18% only. Got tones of error like this
warning: Invalid argument supplied for foreach() in /sites/all/modules/contrib/cnr/corresponding_node_references.crud.inc on line 199.
Not very sure the error are causing the performance problem.
#2
Are you using a multilanguage site?
#3
I have the same issue and I'm running a multilanguage site.
In my case I have contents that are related with others contents (all same content type) in two node reference fields. I have CNR to relate all the corresponding automatically, when I work without CNR I can create and delete without any problem. When I turn on CNR I have to associate only 20 nodes at the same time (in some cases I have nodes that are related with others 400 nodes so I have to edit 20 times the same node) and to delete a node I have to disassociate on the node reference fields (20 node references each time) before delete the node otherwise I get database timeout error.
#4
I just stumbled on this post. Not sure, but maybe replacing all
node_save()calls incorresponding_node_references.crud.incby respectivefield_attach_update()calls could speed things up a little bit?#5
Looks like my suggestion in #4 was implemented in #1334796: Other field data is lost when CNR field is saved.
#6
This would prevent hooks from being triggered. We are updating content so hooks need to be triggered. What could be possible is a setting allowing this for import to make it faster. The one importing should be aware that hooks triggered by a node save are not triggered in this mode and would be responsible to make sure everything is like he wants it.
#7
What are you refering to?
node_save()has already been replaced byfield_attach_update()in #1334796: Other field data is lost when CNR field is saved. The hook problem is being addressed in #1354816: PDOException when updating a node with a CCK link field..So it may now be quicker already, but I can't say whether these changes actually help in terms of importing 18000 nodes, i.e. the original poster's problem.
#8
I was getting similar warning messages as described in #1 when I was deleting nodes (nodes were removed properly though)
Warning: Invalid argument supplied for foreach() in corresponding_node_references_delete() (line 204 of /usr/share/drupal6-strefabiznesu/all/modules/contrib/cnr/corresponding_node_references.crud.inc).Warning: Invalid argument supplied for foreach() in corresponding_node_references_delete() (line 199 of /usr/share/drupal6-strefabiznesu/all/modules/contrib/cnr/corresponding_node_references.crud.inc).
Patch attached. It helps with the warnings, but I doubt it will solve performance problems.