You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dtable-db is the component that provides SQL querying capability in SeaTable server. Users can query their bases with SQL. It also handles archiving for large bases (since Enterprise Edition 2.3.0), to make querying large bases more efficient.
3
+
This is a cheat sheet for the [dtable-db](/introduction/architecture/#seatable-server-container) configuration file `dtable-db.conf`. It contains all possible settings that can be configured as well as their default values.
4
4
5
-
## Configurations
5
+
The default values provided here are best-effort (not built automatically). They will be used, if no value is defined at all. It is not necessary the value, that is written in the configuration file on first startup.
6
6
7
-
The configuration options are available in `dtable-db.conf`. The options are grouped in sections.
7
+
In the default values below, a value in the form `$XYZ` refers to an environment variable.
8
8
9
-
### `[general]`
10
-
11
-
This section contains general settings about dtable-db service.
9
+
??? tip "Configuration changes require a restart"
12
10
13
-
-`host`: The address dtable-db listens on. Defaults to 0.0.0.0.
14
-
-`port`: The port dtable-db listens on. Defaults to 7777.
15
-
-`log_dir`: Location for the dtable-db logs in the container. Defaults to `/opt/seatable/logs`. (Added in 2.3.0)
16
-
-`log_level`: Only log messages with level priority higher than this will be logged. Supported levels are "debug", "info", "warn", "error", with ascending priority. The default is "info".
17
-
-`slow_query_threshold`: If the processing time exceeds this threshold, a slow log will be recorded in addition to the normal log. Unit is in milliseconds. Defaults to 1000 (=1 sec). (Added in 2.3.0)
18
-
-`base_api_limit_per_day`: Limits the number of API calls per base per day. Default is -1, meaning there is no limit.
11
+
New configuration options will only apply after a restart of SeaTable.
19
12
20
-
Please use the following parameters only in very special occasions. In most cases you should use the default values.
13
+
??? abstract "Notes about the configuration file format"
21
14
22
-
-`global_row_update_limit`: Controls the rate of row update/delete/insert per second for the entire system. Row update/delete/insert via SQL and APIs are all affected. This option controls the global rate when there are concurrent updates to multiple bases. The unit is in number of rows. Default is 30000. (Added in 3.0.0)
23
-
-`row_update_limit`: Controls the rate of row update/delete/insert per second for each base. Row update/delete/insert via SQL and APIs are all affected. The unit is in number of rows. Default is 5000. (Added in 3.0.0)
24
-
-`query_per_minute_limit`: Limits the number of API calls per minute for the entire system. Default is 50000. If this value is less than 0, meaning no limits.
15
+
The configuration file uses the **INI format**, which is a simple text-based format for storing configuration data. It consists of sections (denoted by square brackets, e.g., [general]) and key-value pairs.
25
16
26
-
### `[storage]`
17
+
Comments in the configuration file start with the hash symbol `#` and extend to the end of the line.
27
18
28
-
This sections defines where the database files for bases with activated big data backend are stored and when old data is cleaned.
19
+
When dealing with special characters like single quotes `'`, double quotes `"` or the hash symbol `#`, it's generally best to enclose the value in double quotes.
29
20
30
-
-`data_dir`: Location of the data directory in the container. You must specify this option. Typically it is `/opt/seatable/db-data`.
31
-
-`cleanup_at`: The execution time of clean up deleted data. Format is `hh:mm`. Defaults to `00:00`.
21
+
!!! danger "dtable-db reads values from dtable_server_config.json"
32
22
33
-
### `[dtable cache]`
34
-
35
-
This sections contains options for caching bases from dtable-server.
23
+
Note that `dtable-db` reads `dtable_server_config.json` for Redis, MariaDB, and private key settings, even if `dtable-server` is disabled or runs separately. Ensure these configurations are correct.
36
24
37
-
-`dtable_server_url`: local address for dtable-server. You must specify this option. Typically it is `http://127.0.0.1:5000`.
38
-
-`total_cache_size`: size of the base cache in MB. Since 4.4 version, the default is 2000MB (2GB). Before 4.4 version, the default is 500MB. This difference is due to a change of memory consumption estimation algorithm. With 4.4 version the new algorithm is more close to the real memory consumption of the cache.
39
-
40
-
### `[backup]`
41
-
42
-
Section `[backup]` contains options to configure backup functions for big data backend (available since Enterprise Edition 3.0.0):
43
-
44
-
-`dtable_storage_server_url`: The URL of dtable storage server. Required to enable automatic backup. For configuration of dtable storage server, please refer to [this documentation](../configuration/dtable-storage-server-conf.md). You must specify this option. Typically it is `http://127.0.0.1:6666`.
45
-
-`backup_at`: The execution time of backup. Format is `12:30`. The default value is `02:00`. It is mutual exclusion with `backup_interval`. If neither `backup_at` nor `backup_interval` are specified, then `backup_at` will be used by default.
46
-
-`backup_interval`: The interval between each backup. Unit is in seconds. The default value is 86400 (=24 hours). You can not define `backup_interval` and `backup_at` at the same time.
47
-
-`keep_backup_num`: The number of backups that will be kept, oldest backups will be removed. The default value is 3.
48
-
49
-
### `[SQL]`
50
25
51
-
General configuration options of the output of the SQL endpoint.
26
+
Other configuration files are not used, if you run dtable-db separately.
52
27
53
-
-`default_result_rows`: Maximal number of rows that will be returned in one query, if `LIMIT` syntax is not used. Defaults to 100.
54
-
-`result_rows_hard_limit`: Maximal number of rows that will be returned in one query. If the number of rows specified in `LIMIT` syntax is larger than this option, the system still returns at most the number of rows that specified in this option. The default is 10000.
55
-
-`exec_cost_hard_limit`: Maximal execution cost of a query. If the estimated cost of a query exceeds this limit, the query is rejected. Default is 5000000.
28
+
The following options are grouped by their sections.
56
29
57
30
## Example configuration
58
31
59
-
```
32
+
This is a typical configuration file, created automatically on the first startup by SeaTable.
|`host`| The address `dtable-db` listens on. | 0.0.0.0 |
60
+
|`port`| The port `dtable-db` listens on. | 7777 |
61
+
|`log_dir`| Location for the `dtable-db` logs in the container. | /opt/seatable/logs |
62
+
|`log_level`| Only log messages with level priority higher than this will be logged. Supported levels are "debug", "info", "warn", "error", with ascending priority. | info |
63
+
|`slow_query_threshold`| If the processing time exceeds this threshold, a slow log will be recorded in addition to the normal log. Unit is in milliseconds. | 1000 |
64
+
|`query_per_minute_limit`| Sets the total max. of API calls per minute for the entire system. The default is suitable for most cases. | 50000 |
65
+
66
+
Please use the following parameters only in very special occasions. In most cases you should use the default, which means no limitation.
|`dtable_storage_server_url`| The URL of dtable storage server. Required to enable automatic backup. |http://127.0.0.1:6666|
111
+
|`backup_at`| The execution time of backup. Format is like `12:30`. It is mutual exclusion with `backup_interval`. | 02:00 |
112
+
|`backup_interval`| The interval between each backup. Unit is in seconds. The default value is 86400 (=24 hours). You can not define `backup_interval` and `backup_at` at the same time. ||
113
+
|`keep_backup_num`| The number of backups that will be kept, oldest backups will be removed. | 3 |
114
+
115
+
!!! warning "Important change with 5.2"
116
+
117
+
The logic for big data backup will change with version 5.2. Next to `keep_backup_num`, new options will be available.
118
+
76
119
## Deprecated or removed options
77
120
78
-
### [database]
121
+
### `[database]`
79
122
80
-
!!! note "Not necessary anymore"
123
+
??? note "[database] is not necessary anymore"
81
124
82
-
Since version 2.7 this complete section `[database]` is no longer used. dtable-db will use the database settings in `conf/dtable_server_config.json`.
125
+
Since version 2.7 this complete section `[database]` is no longer used. `dtable-db` will use the database settings in `conf/dtable_server_config.json`.
83
126
84
-
The section `[database]`contains options for accessing the MySQL database used by dtable-server. Note:
127
+
The section `[database]` contained options for accessing the MySQL database used by dtable-server.
85
128
86
-
-`host`: Address of database. You must provide this option.
87
-
-`port`: Port of database. Defaults to 3306.
88
-
-`user`: Username for login to the database. You must provide this option.
89
-
-`password`: Password for the database user. You must provide this option.
90
-
-`db_name`: Database name used by dtable-server. You must provide this option.
129
+
- `host`: Address of database. You must provide this option.
130
+
- `port`: Port of database. Defaults to 3306.
131
+
- `user`: Username for login to the database. You must provide this option.
132
+
- `password`: Password for the database user. You must provide this option.
133
+
- `db_name`: Database name used by dtable-server. You must provide this option.
91
134
92
-
### [dtable cache]
135
+
### `[general]`
136
+
137
+
-`base_api_limit_per_day`: Limits the number of API calls per base per day. -1 means no limit.
138
+
139
+
### `[dtable cache]`
93
140
94
141
-`private_key`: Must be the same value like `DTABLE_PRIVATE_KEY` in `dtable_web_settings.py`. Only necessary if your version is before "Enterprise edition 3.5.5". If your version is newer the value is read from `dtable_server_config.json`.
95
142
-`clean_cache_interval`: Interval between cache cleaning. Unit is in seconds. Defaults to 300. This option is removed in "Enterprise edition 4.4.0". Since 4.4.0 a real-time eviction mechanism replaced regular cache cleanup mechanism.
96
143
97
-
### [SQL]
144
+
### `[SQL]`
98
145
99
146
-`group_by_stmt_limit`: Maximal number of concurrent `group by` requests. If the number of `group by` requests exceeds this limit, new `group by` queries will wait in a queue. Default is 2. This option is removed in version 5.1.0. This option was only relevant when querying bases with big-data. In 5.1.0 version `group by` queries can be handled by a new OLAP engine, which is much more efficient. So this option is no longer necessary.
147
+
148
+
<!-- to clarify with DJ
149
+
- general: dev_mod
150
+
- general: op_log_delete_restore_threshold
151
+
- general: transaction_timeout
152
+
- metrics: aufnehmen?
153
+
- profiling?
154
+
- sql all these xxxCost?
155
+
- SnapshotAfterEntries ?!?
156
+
- what is olap?
157
+
- when configuration is only read from dtable-db???
158
+
- configuration defaults sind andere als von configuration beim ersten start geschrieben. gewollt? Beispiel host: 0.0.0.0 is default, geschrieben wird 127.0.0.1. Warum überhaupt? Wir nutzen docker, dort ist erstmal nur aus docker netzwerk erlaubt.
159
+
- was ist tls in der configuration?
160
+
- ENV: SEATABLE_LOG_TO_STDOUT ?!? scheint irgendwie parallel zu LOG_DIR
0 commit comments