Back to Shardingsphere

Props.En

docs/document/content/user-manual/common-config/props.en.md

5.5.33.9 KB
Original Source

+++ title = "Properties Configuration" weight = 1 chapter = true +++

Background

Apache ShardingSphere provides the way of property configuration to configure system level configuration.

Parameters

NameData TypeDescriptionDefault Value
sql-show (?)booleanWhether show SQL or not in log.
Print SQL details can help developers debug easier. The log details include: logic SQL, actual SQL and SQL parse result.
Enable this property will log into log topic org.apache.shardingsphere.sql, log level is INFOfalse
sql-simple (?)booleanWhether show SQL details in simple stylefalse
kernel-executor-size (?)intThe max thread size of worker group to execute SQL. One ShardingSphereDataSource will use a independent thread pool, it does not share thread pool even different data source in same JVMinfinite
max-connections-size-per-query (?)intMax opened connection size for each query1
max-union-size-per-datasource (?)intMax union size per datasource for aggregate rewrite. When route units count for a datasource exceeds this value, they will be split into batches to restore parallel execution capabilityInteger.MAX_VALUE
check-table-metadata-enabled (?)booleanWhether validate table meta data consistency when application startup or updatedfalse
load-table-metadata-batch-size (?)intThe number of table metadata loaded at a time when application startup or refreshes table metadata1000

Procedure

  1. Properties configuration is directly configured in the profile used by ShardingSphere-JDBC. The format is as follows:
yaml
props:
    sql-show: true

Notes

The default value of the max-connections-size-per-query configuration is 1, meaning each query request can only use one connection per database instance. If you adjust this parameter to enable memory-restricted mode (see Memory-Strictly Mode for details), ensure that your database's JDBC implementation supports streaming queries or can enable them. For example, in MySQL, you need to set statement.setFetchSize(Integer.MIN_VALUE) to achieve streaming queries.

Sample

The example of ShardingSphere warehouse contains property configurations of various scenarios. Please refer to: https://github.com/apache/shardingsphere/tree/master/examples