We're running into a significient performance hit when using personalization on a site. When checking SQL Profiler we see a query like the following for each personalization profile.
SELECT * FROM AccessUser WHERE AccessUserID IN (SELECT AccessUser.AccessUserID FROM AccessUser WHERE AccessUserType IN (1,3,4,5,15) AND (AccessUser_church_keyboard_Piano = 1)) ORDER BY AccessUserActive Asc
The site has over 100K users, so even with an index on the AccessUser_church_keyboard_Piano boolean field, the query takes 3-6 seconds. So for 8 personalization profiles, it's taking about a minute for pages to load.
Shouldn't that query have a where clause filter for the logged in user? So it should be something like:
SELECT * FROM AccessUser WHERE AccessUserID IN (SELECT AccessUser.AccessUserID FROM AccessUser WHERE AccessUserType IN (1,3,4,5,15) AND (AccessUser_church_keyboard_Piano = 1)) AND AccessUserId = 12345 ORDER BY AccessUserActive Asc
That should make the query be almost instant. Does that sound right?
Thanks,
Scott