Closed (fixed)
Project:
Workflow
Version:
5.x-1.1
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Jul 2007 at 11:40 UTC
Updated:
20 Jun 2009 at 05:50 UTC
Jump to comment: Most recent file
same queries executed more than once:
workflow_get_workflow_for_type: SELECT wid FROM workflow_type_map WHERE type = '$type'
_workflow_creation_state: SELECT sid FROM workflow_states WHERE wid=0 AND sysid=$sysid
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | workflow_8.patch | 871 bytes | baldwinlouie |
| #1 | workflow_7.patch | 907 bytes | baldwinlouie |
Comments
Comment #1
baldwinlouie commentedI've created a quick patch that simply caches the results of these two queries in a static variable.
Please help in testing this patch.
Comment #2
jmiccolis commentedI've noticed the same issue, and the above patch looks reasonable to me - however I'm not too familiar with the internals of the workflow module. Are there any reasons not to do a simple static cache like this?
Comment #3
JacobSingh commentedPatch looks okay, however your variable naming is odd. You are setting $results['wid'] to the $sid. Also, I'd say for the sake of clarity, don't use the $results array unless absolutely needed. It doesn't seem to add value here.
Best,
Jacob
Comment #4
JacobSingh commentedPlease take a look at the above and re-submit, we'll get it into the next revision.
Comment #5
baldwinlouie commentedrenamed the $results variable to $cache and also removed the explicit array initialization. Let me know if there are other things that needs changing.
Comment #6
JacobSingh commentedThanks! Looks good. I'm putting it in
Comment #7
deekayen commentedThis is in 6.x-1.1.