Person Data loading is very slow for normal users in Web Portal

As part of self service action, I have created a custom module for a new page to display some generic accounts wherein I have added  a button (to select a new owner) that gets enabled for selected items of the grid data.Once the user clicks on the button it loads the person data (using Database(automatic) directly in the gridband of database collection called 'PersonToSelect' with the where clause below. Post the display of such person records, user can select any record (InternalName of person record) to be the owner of the selected accounts, which will be saved via webportal in the database.
sqland(
SqlCompare("IsInActive", false, "bool", "equal"),
SqlCompare("IsTemporaryDeactivated", false, "bool", "equal"),
SqlCompare("UID_PersonMasterIdentity", "", "string", "notequal", "nonunicodeliterals"),
SqlCompare("IsDummyPerson", false, "bool", "equal"),
"UID_IdentityTypeOrg in (select UID_Org from Org where Ident_Org in ('SapHRImport'))"

Now the concern is the loading of person data is very slow for normal users (taking around 1- 2 mintues), but for admin users the loading takes around 5-8 seconds. Post checking the log file in application server, t her query found for normal user is as below

select Person.UID_Person, xxxSelect.XGroupBitPattern as XSelectGroupBitPattern, xxxSelect.XGroupMask as XSelectGroupMask from Person join

                                                                               (

                                                                                              select sum(distinct(x.XGroupBitPattern)) as XGroupBitPattern, 0x020000010100000000000100000000 as XGroupMask, XXPrimaryKey1

                                                                                                              from(

                                                                                                                                              select 2 as XGroupBitPattern, UID_Person as XXPrimaryKey1 from Person where (exists (select top 1 1 from dbo.QER_FTHelperHeadOrgChildren ('df43c1cb-69d7-4356-a46c-a58604ee152d') c join HelperPersonOrg as hpo on hpo.UID_Org = c.UID_Org where Person.UID_Person = hpo.UID_Person) or exists (select top 1 1 from dbo.QER_FTHelperHeadOrgChildren ('df43c1cb-69d7-4356-a46c-a58604ee152d') c join PersonInBaseTree as hpo on hpo.UID_Org = c.UID_Org where Person.UID_Person = hpo.UID_Person) or exists (select top 1 1 from HelperHeadPerson hh where hh.UID_PersonHead = 'df43c1cb-69d7-4356-a46c-a58604ee152d' and XOrigin > 0 and person.UID_Person = hh.UID_Person))

                                                                                                                                              union all

                                                                                                                                              select 4 as XGroupBitPattern, UID_Person as XXPrimaryKey1 from Person where (exists (select top 1 1 from QER_FTPersonsAreMe ('df43c1cb-69d7-4356-a46c-a58604ee152d') f where f.UID_Person = Person.UID_Person))

                                                                                                                                              union all

                                                                                                                                              select 9 as XGroupBitPattern, UID_Person as XXPrimaryKey1 from Person where (IsInActive = 0)

                                                                                                                              ) x

                                                                                                              group by XXPrimaryKey1

                                                                               ) xxxSelect on xxxSelect.XXPrimaryKey1 = Person.UID_Person  where (((IsInActive = 0) and (IsTemporaryDeactivated = 0) and (NOT isnull(UID_PersonMasterIdentity, '') = '') and (IsDummyPerson = 0) and (UID_IdentityTypeOrg in (select UID_Org from Org where Ident_Org in ('SapHRImport')))))

whereas for admin users, the query is as below in the log file

select UID_Person from Person where (((IsInActive = 0) and (IsTemporaryDeactivated = 0) and (NOT isnull(UID_PersonMasterIdentity, '') = '') and (IsDummyPerson = 0) and (UID_IdentityTypeOrg in (select UID_Org from Org where Ident_Org in ('SapHRImport')))))

 Are the permissions of normal users really causing the slowness of the loading? if so, how can it be faster for admin users and no such permissions are shown in the log file for them? since the permissions are by default for such users and unable to edit as well Is there any possible quick solution to improve the loading time?

Parents Reply Children
  • The reason why the admin user is seeing a faster and shorter query is that I assume that your admins are allowed to see and edit all persons, hence they have an 1=1 condition in the CanSee and CanEdit where clauses for the table person. The object layer is then able to optimize the where clause, hence the shorter loading time.

    I do know, that we had some performance optimizations in regards to the web portal and to some of the underlying permission queries in later service packs that may help you in your situation as well.

    I assume you already checked the SQL server performance, in general, using the System Overview page available in the rich clients.

    In addition, I suggest contacting support to identify in detail, why your queries are so slow.