Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Performance and...Performance and...Major performance issue, GetAllTabs 22 seconds to runMajor performance issue, GetAllTabs 22 seconds to run
Previous
 
Next
New Post
5/12/2010 7:56 PM
 
Hi All,

I am having a major performance issue with the stored procedure GetAllTabs. It is taking about 22 seconds to run. The procudeure executes vw_Tabs that looks like this:

SELECT     TabID, TabOrder, PortalID, TabName, IsVisible, ParentId, [Level], CASE WHEN LEFT(LOWER(T .IconFile), 6) = 'fileid' THEN
                          (SELECT     Folder + FileName
                            FROM          dbo.Files
                            WHERE      'fileid=' + CONVERT(varchar, dbo.Files.FileID) = T .IconFile) ELSE T .IconFile END AS IconFile, DisableLink, Title, Description, KeyWords, IsDeleted,
                      SkinSrc, ContainerSrc, TabPath, StartDate, EndDate, Url, CASE WHEN EXISTS
                          (SELECT     1
                            FROM          dbo.Tabs T2
                            WHERE      T2.ParentId = T .TabId) THEN 'true' ELSE 'false' END AS HasChildren, RefreshInterval, PageHeadText, IsSecure
FROM         dbo.Tabs AS T

I have 1200 portals and about 57,000 tabs in the database. I am wondering if there is any way to modify the stored procedure to be usable in situation similar to mime with installs running many portals with many tabs.

Thanks in advance!

DNN Skin Killer - The DotNetNuke Skin that Kills All Others.
 
New Post
5/12/2010 11:12 PM
 
Without lookign at a query plan, the first thing I would concentrate on is removing the two CASE statements from the sql.
Since it's a given you're going to be modifying the core code to improve performance, here's what I would suggest:
1)  Run an update on the IconFile column so that all references are the filename, and not the fileId, and then remove the first case statement.  I expect this is for backwards compatibility purposes,  rather than any other reason.  You might have to periodically run this update for new portals/pages with icons.  This will eliminate the expensive subquery on the Files table, if it is being used (your references might all be direct, so the query is not being run)  There will also be a cost in running a substring operation on the IconFile column, so eliminating this alone may well yield decent returns.

If that doesn't improve things, consider how to restructure the 'HasChildren' value.  You could do this by creating a new table which contained the 'hasChildren' column in it, and run an update based on a insert/update/delete trigger (which calculates both parent/chidl relationships on the change in a Tab record).  It would then be easy to join to the 'hasChildren' table and retrieve this value without the expensive subquery and this would greatly improve the speed of the query.

Bear in mind these are only guesses and you should have a test database that you can experiment on for changes.
 
New Post
5/13/2010 12:18 PM
 
Hey Bruce, thanks very much for you detailed response. I'll let you know what ends up working. BTW - I am using your ifinity URL Master and having a similar issue with the sp: [ifty_GetTabsAndRedirects] ..but I am trying to work on the GetAllTabs sp first and see what I can come up with. thanks!

DNN Skin Killer - The DotNetNuke Skin that Kills All Others.
 
New Post
5/18/2010 6:20 PM
 
Ok, I'm not sure what your trying to do, but the first thing I would say is: Find a way to get the Portal ID in there. 

When a client makes a request for a page from a portal, why would you pull back all the tabs for ALL the portals? You should only concern yourself with the tabs on the portal currently being requested. 

On my database: 384 portals, 94k tabs. That query pulls back a HUGE dataset, and even if the query itself didn't take a huge amount of time to run, it's going to be sending a big chunk of data to the webserver which takes network AND memory resources.  I already found one bug (which I fixed in my instance, and according to the core team, is no longer an issue) where the code wasn't using the portal id to restrict the recordset, resulting in the webserver being unusable. I traced the code down and fixed it, and the webserver went from over 1 minute (if ever) on initial load) to like 15 seconds. 

Hope this helps.
 
New Post
5/19/2010 4:10 AM
 
Rick, this is a view, not a stored procedure. the view will be used by an sproc, usually filtered by portalID and sql server will only calculate affected records (if table indexes are properly set).

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Performance and...Performance and...Major performance issue, GetAllTabs 22 seconds to runMajor performance issue, GetAllTabs 22 seconds to run


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out