Database and Operations for Gas Yield Rates

Gas yield rate-related data primarily comes from gas listed quotes from domestic energy trading centers, operation scheduling reports from local

What the Data for This Category Looks Like

Gas yield rate-related data primarily comes from gas listed quotes from domestic energy trading centers, operation scheduling reports from local municipal public utilities, and gas consumption statistics from regional gas users. The data updates on a daily T+1 cadence, and is used to generate the same day’s yield rate daily report. Each record corresponds to yield metrics for a single administrative region on a single day. The document structure includes fields such as stat_date, region_code, region_name, factory_purchase_price, terminal_sale_price, transmission_cost, and gross_profit_per_cbm. Price-related fields use yuan per cubic meter as their unit. Region codes are 6-digit administrative division codes, and the date format is YYYY-MM-DD.

Constraints on Database and Operations Workflows

Multi-source data access requires the database to support cross-source connections and data consolidation, which places higher requirements on connection pool concurrency configuration. The fixed T+1 batch update cadence requires controlling the volume of data written per batch to avoid frequent database table locking or IO spikes. High-frequency query scenarios by region and date require creating a joint index for the region_code and stat_date fields, as well as partitioning historical data by date to reduce the scan range during queries. Field standardization rules mandate strictly limiting the scope of returned fields to avoid redundant data that increases context processing overhead.

Configuration Recommendations

Configuration ItemRecommended ValueRationale
mongodb_connection_timeoutMS30000 millisecondsBatch writes for gas data have certain network latency; this value prevents normal connections from being misjudged as timed out
mysql_batch_insert_size200-500 records per batchModerate per-batch data volume balances database write performance and table locking risk
db_index_expire_days180 daysQuery hotspots for daily report data are concentrated in the last 90 days; expired indexes free storage resources and optimize query speed
multi_source_db_enableEnabledGas yield rate data needs to connect to both energy trading platform and local operation report data sources; multi-source configuration enables data consolidation
db_partition_strategyDaily partitioning by stat_dateData is updated in batches by date; partitioned storage significantly improves efficiency for date range queries
connection_pool_max_size20-30Adapts to concurrency requirements for multi-source connections, avoiding service interruptions caused by exhausted connections

The parameter values provided on this page are general recommendations used as a starting point for configuration. Actual values are affected by material form, data volume, and business rules. Specific issues require targeted analysis, and it is recommended to test on your own samples before finalizing settings.

Three Common Configuration Mistakes

  • A 400 status code with no response body is returned when using MySQL tools. The cause is that permission parameters for mysql_connection_string are not configured correctly, leading to failed database connection verification and request interception.
  • A MongoDB connection timeout is displayed when running pnpm dev in a local development environment. The cause is that the mongodb_connection_timeoutMS configuration value is set too small, and network latency in local development environments is higher than the default value, leading to failed connection establishment.
  • Database queries return redundant fields, causing associated model invocation token consumption to differ from actual API usage. The cause is that db_query_field_whitelist is not configured, and unused off-business fields are returned, increasing context processing length.

How to Confirm Configuration Is Complete

  • Run the built-in database connectivity test tool to verify that all configured data sources can establish normal connections with no timeout or permission errors.
  • Submit a batch of simulated gas daily report data, observe database write performance, and confirm no table locking or timeouts occur.
  • Check the database partition configuration to confirm that data is stored partitioned by stat_date.
  • Configure field filtering rules, and verify that query returned fields only include preset business metrics with no redundant data.

Question material comes from public community discussions. Configuration values are common starting points and should be measured against your own samples. Verified on 2026-09-14.