Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Warren Harding 132 posts 275 karma points
    Nov 14, 2016 @ 06:42
    Warren Harding
    0

    Umbraco or Forms performing 1500+ extra queries

    Hi there, we have an issue with our Umbraco site performing some 1547 queries that don't appear to be necessary, which in turn is causing a 3 second delay on the page load.

    We have tested this form in Umbraco 7.3 up to 7.5.4 all with Forms versions 4.1 to 4.3.3 and have not had any luck as yet.

    We have a simple page template setup which in turn load a marginally complex form consisting of 4 pages. When not logged in the page loads in 30ms however when logged in it is taking 3 seconds.

    The queries that are being executed are identical - exporting an SQL Profiler dump out to excel and removing duplicates removed this number (1547). This query was:

    exec sp_executesql N'SELECT *
    FROM [cmsMember]
    INNER JOIN [cmsContentVersion]
    ON [cmsContentVersion].[ContentId] = [cmsMember].[nodeId]
    INNER JOIN [cmsContent]
    ON [cmsContentVersion].[ContentId] = [cmsContent].[nodeId]
    INNER JOIN [cmsContentType]
    ON [cmsContentType].[nodeId] = [cmsContent].[contentType]
    INNER JOIN [umbracoNode]
    ON [cmsContent].[nodeId] = [umbracoNode].[id]
    WHERE (([umbracoNode].[nodeObjectType] = @0))
    AND (upper([cmsMember].[LoginName]) = upper(@1))
    ORDER BY ([umbracoNode].[sortOrder])',N'@0 nvarchar(40),@1 nvarchar(4000)',@0=N'39eb0f98-b348-42a1-8662-e7eb18487560',@1=N'[email protected]'
    

    Mini-profiler is stating all this time is inside InsertUmbracoForm.cshtml however Form.cshtml and Script.cshtml have been untouched and contain no member data.

    Trace and Debug are both false in the web.config too.

    Anybody have any advise on what we can do or test from here?

    Thank you for your help, Warren

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Nov 14, 2016 @ 07:29
    Dave Woestenborghs
    0

    We saw this also once in a project.

    Every time we would use the membership helper it would result in a several db queries. Especially the GetById method.

    I suspect the there is something in Umbraco forms calling this to check if a member is logged in.

    We ended up writing a wrapper method around this which caches the result for the current request.

    But I don't think this is something you can do with umbraco forms

    Dave

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Nov 14, 2016 @ 10:37
    Warren Buckley
    0

    Hi Warren,
    Sorry to hear about this.

    I am about to setup a test site to replicate this, are there any specifics or things I need to know about to replicate this problem so I can see what is causing this & how it can be fixed.

    Cheers,
    From the other Warren :)

  • Warren Harding 132 posts 275 karma points
    Nov 15, 2016 @ 06:10
    Warren Harding
    0

    Sorry for the delay, we are still trying to strip out our code to provide a base sample of the project to test.

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Nov 15, 2016 @ 08:57
    Warren Buckley
    0

    OK no problem Warren.

    Just some notes or steps to reproduce would have been fine, but if you are going to the effort to provide the site & files then this will be a lot easier for us to find the root of the problem.

    If you prefer to send this privately then post here, then feel free to email on the work address warren at umbraco com

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Nov 15, 2016 @ 09:22
    Dave Woestenborghs
    0

    @Warren Buckley.

    Are you using membershiphelper in your code ? this always hits db.

    Dave

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Nov 30, 2016 @ 09:09
    Warren Buckley
    0

    Apologies for the delay, I have not long got back from my holiday.

    @warren has this been resolved or rectified for you? I will look for some clues around MembershipHelper but Warren if you can offer me some more advice or details to reproduce then would be happy to look into this further.

    Thanks,
    Warren :)

Please Sign in or register to post replies

Write your reply to:

Draft