Hello,
I am seeing a large number of SLOWSQL warnings in Service Center on queries which are searching for Users. These warnings are across a number of different queries, some Aggregates and some Advanced SQL.
An example of one of our Advanced Queries which took a maximum of 11.6 seconds to run in Production yesterday:
SyntaxEditor Code Snippet
SELECT {User}.* FROM {User} JOIN {User_Role} on {User_Role}.[User_Id] = {User}.[Id] WHERE {User_Role}.[Role_Id] = @RoleID AND {User}.[Is_Active] = 1 AND {User}.[Name] <> 'Administrator' ORDER BY {User}.[Username]
I have had a look at the User table which shows an index on only the Username attribute. Is this correct should there be and are there indexes on other attributes which as can't see? We don't have direct access to the Database so can't look for exactly what indexes are there.
We are in the Cloud using v9.1.501 on the Java / Oracle stack. I don't believe we can use the Cache in Minutes option to try and Cache the results of these queries, is there an alternative option for caching in Java?
Is it possible to create a materialized view through Outsystems? We only need to query about 1000 out of our 10000 users who have a specific role so it may be useful if we could create a view of only these users. Is this possible?
Thanks, Stuart