Hi All,
I am seeing significant difference in query times when querying a tabular database as a user in an administrator role versus querying it as a user in a read-only role. I’m using Profiler to measure query times. When in the administrator role, my test query returns in 2.3 seconds. If I change the role to only read access, the query then returns in over 15 seconds.
Aspects of the test:
- The query was created using the SSRS Report Designer
- It returns only one measure (a simple SUM) and four attributes, all from the same table. Although there are two filters, one on the same table and one on a related date table.
- The attributes return include the business key so it effectively returns every fact.
- The result set contains roughly 7900 rows.
- The role I'm testing with is a brand new role with NO row filters defined.
Things I’ve looked at:
- Memory: Using Performance Monitor I’ve determined the SSAS memory usage doesn’t even come near the Memory Limit Low for either run of the query. So memory doesn’t seem to be an issue.
- Storage Engine: Using Profiler, I can see that the storage engine queries complete within the first second of the query in both runs.
- Formula Engine: This seems to be where the difference is. I believe most of the 15 seconds of the longer query are spent here. During the long query, the CPU stays at around 25% (server has 4 cores) and the only events I see in Profiler are “Serialize Results Current - 3 – Serialize SQL Rowset”. There are the same number in both queries, but they come about 2-3 seconds apart in the longer query and almost immediately after each other in the shorter query.
Other:
- 15 seconds is almost tolerable, but this is with a simplified query. The business would like more filters on the query and more fields returned. Running the query they want returns in 6 seconds for an admin role and over a minute for a read-only role.
- I am discussing with the business the possibility of crafting a query that returns fewer rows.
- Although the role I'm testing with has no row filters, the final solution will.
- I can post my query and any other information that may be helpful to diagnose.
I would expect that a query would take a little longer for a user not in an admin role, but not an order of magnitude longer - especially considering the read-only role still has full read access to all the data.
Thanks in advance for your help.
Regards,
Doug