Closed (fixed)
Project:
Panels
Version:
5.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
5 Jun 2008 at 15:59 UTC
Updated:
23 Jul 2008 at 10:56 UTC
Jump to comment: Most recent file
While panels_page_list_page and panels_mini_list_page do make use of the _load_all functions to retrieve the panels, they retrieve the appropriate displays one by one per panel. This adds up to one additional db query per panel.
Enclosed patch modifies the two functions to bulk-retrieve the displays of the given panels. This saves time if the list is long and doesn't do any harm if there's only one or two entry (the bulk query takes about the same time as each single query does).
Has been tested, except for programmatic panels.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | panels-DRUPAL-5--2.load-displays.patch | 2.87 KB | sun |
| panels_x_list_page.patch | 2.47 KB | pancho |
Comments
Comment #1
sunGood one! You missed to replace the subsequent call to *_load_all() in both foreachs.
Other than that, I've tested this, and it's RTBC!
Comment #2
panchoOh well, you are absolutely right, I was spoiling some of the performance gain... That's why peer reviews are a great thing. Thanks!
Comment #3
sun*bump*
I can confirm this patch works as claimed on a high production site.
Comment #4
sdboyer commentedNice catch on this, it never occurred to me that this is the way foreachs split up the array parameter you pass in when it's a mysql resource. Committed.
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.