| Previous topic :: Next topic |
| Author |
Message |
strix
Joined: 04 Nov 2005
Posts: 17
|
| Posted: Fri Dec 02, 2005 5:08 pm Post subject: Efficency fix for list views |
|
|
My suggestion is that the queries to profile2field and def_org_field in getListViewEntries() in include/utils.php be moved.
The problem is that for every list view each field name is queried once for each column for example the Activities list view has 8 columns associated with it, thats 8 queries plus one to find the owner plus one each for Edit and Delete permissions, thats 11 queries for each row.
for example if a user has 100 activies(which is not an unreasonable figure) thats 1100 queries.
My solution is simple do the queries before getListViewEntries() and pass the results to the functionby changing the $list_fields variable in $focus. that way theres no extra arguments and it will only change the current instance of Account. so that leaves you with N*3+8 instead of N*11 queries.
i have no problem implementing a patch and posting it but i want some feedback on it first |
|
| Back to top |
|
Bushwack
Joined: 23 Aug 2005
Posts: 236
|
| Posted: Fri Dec 02, 2005 6:41 pm Post subject: Efficency fix for list views |
|
|
Check out this:
http://forums.vtiger.com/viewtopic.php?p=15163#15163
I think that patch does what you want.
It's a different approach then you're suggesting but the end result (a heck of a lot fewer queries) is the same. |
|
| Back to top |
|
strix
Joined: 04 Nov 2005
Posts: 17
|
| Posted: Fri Dec 02, 2005 7:38 pm Post subject: Re: Efficency fix for list views |
|
|
Thanks for the post, I'll have to take a look at how you approached it, it sounds interesting. From your description it sounds like what your doing is querying before the loop on $focus->list_fields then checking the name of the list field against the data from the query.
I still like my approach better (lol, big suprise right, i'm a programmer and I like my way better :D )
I'm not gonna go on about how my solution does fewer queries than yours(if it works the way I think it does, and it wouldnt really be that significate either) I'm just glad that I'm not the only one who noticed the rediculious # of queries that are possible here.
Good work |
|
| Back to top |
|
eberled
Joined: 24 Nov 2004
Posts: 368
Location: St.Gallen, Switzerland
|
| Posted: Fri Dec 02, 2005 10:17 pm Post subject: Re: Efficency fix for list views |
|
|
Hi strix
I'm not a programmer just a happy vtiger user... But I'm not satisfied with the performance. With increasing number of entries vtiger gets solwer and slower.
If I can do some performance checks for you let me know.
Regards,
Dino |
|
| Back to top |
|
| |