tac_lite_db_rewrite_sql() does a bunch of work every time it's called, regardless of the query's primary field.
I've attached a patch which moves that code inside the 'tid' case for the primary field switch statement.
I haven't tested this, as I might not be using the module after all; but I'd noticed the issue while I was looking at it.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 461074.diff | 2.22 KB | Dave Cohen |
| #1 | tac_lite-6.x-db_rewrite.patch | 2.05 KB | AlexisWilke |
| tac_lite.module.patch | 2.47 KB | jweowu |
Comments
Comment #1
AlexisWilke commentedDave,
Got to agree with jweowu! The db rewrite function is not well optimized.
I have a better patch which makes it even faster. For instance, I exit the function immediately when the field isn't 'tid'. And the loop used a variable_get() which I replaced with a $max variable. That's got to be a lot better if you have "many" schemes.
Thank you.
Alexis Wilke
Comment #2
indytechcook commentedThis works great. Setting to RTBC.
Comment #3
tjharman commentedI have tested this patch. It breaks the ability to edit an individual users tac_lite permissions.
With the patch:
http://xxxxx.com/user//edit/tac_lite
Gives a page not found error.
Without the patch, it works and I can edit permissions.
Anyone else see this?
Comment #4
tjharman commentedSorry - I'm a total idiot.
I had the file permissions wrong after patching.
Apologies. Still testing.
Comment #5
liquid06 commentedI am unable to apply the patches in #0 or #1 to the latest -dev release (6.x-1.x-dev June 22, 2010). This issue's version tag is 6.x-1.x dev so I'll paste the patch results I got for that version - just for fun I also tried applying the patches to the latest stable release (right now is 6.x-1.3 March 20, 2009) but I had no luck.
Patch from #0 against 6.x-1.x-dev:
Patch from #1 against 6.x-1.x-dev:
Comment #6
AlexisWilke commentedliquid06,
It looks like the Jun 22, 2010 1.x-dev version includes my patch in #1.
I will let Dave deal with the status though.
Thank you.
Alexis
Comment #7
achtonsubscribing
Comment #8
nally commentedsubscribe
Comment #9
Dave Cohen commentedIt's been a while so the patch didn't apply exactly, but I did check in the patch here.