atjiu / pybbs

更实用的Java开发的社区(论坛),Better use of Java development community (forum)
GNU Affero General Public License v3.0
1.84k stars 706 forks source link

Add Index on system_config.`key` to Accelerate Query #108

Closed wtune closed 4 years ago

wtune commented 4 years ago

Missing index on table system_config column key might make the underlying query issued via ISystemConfigService#selectByKey slow. Since table system_config is mostly read and rarely updated, the performance impact for write operations is acceptable under common cases.

atjiu commented 4 years ago

The data in the system_config table is limited, and it is cached after being queried once in the SystemConfigService. Subsequent queries will not be queried in the database unless the data in the system_config table changes, so this index is the same whether it is added or not.