Some Creatio database queries take a long time to process, which might affect page loading or task completion time significantly. Such queries are usually called “heavy.” They include:
- complex filters in pages and dynamic folders
- complex analytical selections in section dashboards
- complex custom queries implemented using development tools
You can accelerate the processing of heavy queries by forwarding them to a read-only database replica. This will reduce the load on the main database significantly and free up resources for the activity of users and the operation of other Creatio elements.
To set up the redirection of heavy queries, take the following steps:
- Create a read-only database replica.
- Configure access to the database replica in Creatio.
Step 1. Create a database replica
The procedure to create a database replica is DBMS-specific. Learn more about the process in vendor documentation:
- Create a database replica in PostgreSQL.
- Create a database replica in Microsoft SQL.
- Create a database replica in Oracle.
Step 2. Set up redirection of heavy queries
-
Set up redirection of heavy queries to the database replica. Perform the setup in the Terrasoft.WebHost.dll.config file for Creatio .NET Core and .NET 6 and in the web.config file for Creatio NET Framework.
-
Select the UseQueryKinds checkbox.
-
Add the replicaConnectionStringName="db_Replica" value to the db general parameter.
-
-
Configure access to the database replica in Creatio. To do this, add the db_Replica parameter to the ConnectionStrings.config file:
<add name="db_Replica" connectionString="Data Source=(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = [ Database server name ])(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = [ Oracle service name ]) (SERVER = DEDICATED)));User Id=[ Schema name ];Password=[ Schema password ];Statement Cache Size = 300" />