merge ci/mysql-perf:bep_order 复合索引
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 16s

This commit is contained in:
2026-11-25 08:50:13 +08:00
2 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -65,7 +65,7 @@ type Order struct {
Id
OrderId string `gorm:"column:order_id;type:varchar(128);not null;index;comment:商户ID" json:"order_id"`
TradeId string `gorm:"column:trade_id;type:varchar(128);not null;uniqueIndex;comment:本地ID" json:"trade_id"`
TradeType TradeType `gorm:"column:trade_type;type:varchar(20);not null;index;comment:交易类型" json:"trade_type"`
TradeType TradeType `gorm:"column:trade_type;type:varchar(20);not null;index;index:idx_order_status_trade,priority:2;comment:交易类型" json:"trade_type"`
Fiat Fiat `gorm:"column:fiat;type:varchar(16);not null;index;default:CNY;comment:法定货币" json:"fiat"`
Crypto Crypto `gorm:"column:crypto;type:varchar(16);not null;index;default:USDT;comment:加密货币" json:"crypto"`
CurrencyLimit string `gorm:"column:currency_limit;type:varchar(255);not null;default:'';comment:限定币种" json:"currency_limit"`
@@ -76,7 +76,7 @@ type Order struct {
FromAddress string `gorm:"column:from_address;type:varchar(128);not null;default:'';comment:支付地址" json:"from_address"`
MatchAddress string `gorm:"column:match_address;type:varchar(128);not null;default:'';comment:校验地址" json:"match_address"`
AddressLocked bool `gorm:"column:address_locked;not null;default:false;comment:地址锁定 1:独占 0:共享" json:"address_locked"`
Status int `gorm:"column:status;not null;default:1;index;index:idx_order_notify_retry,priority:1;comment:交易状态" json:"status"`
Status int `gorm:"column:status;not null;default:1;index;index:idx_order_notify_retry,priority:1;index:idx_order_status_trade,priority:1;comment:交易状态" json:"status"`
Name string `gorm:"column:name;type:varchar(64);not null;default:'';comment:商品名称" json:"name"`
ApiType string `gorm:"column:api_type;type:varchar(20);not null;default:'epusdt';comment:API类型" json:"api_type"`
ReturnUrl string `gorm:"column:return_url;type:varchar(1024);not null;default:'';comment:同步地址" json:"return_url"`
+3 -1
View File
@@ -26,9 +26,11 @@ services:
- --collation-server=utf8mb4_unicode_ci
- --default-time-zone=+08:00
# 小机器(1~2G 内存)建议打开下面三行,省内存也省 CPU
# - --innodb-buffer-pool-size=96M
# - --innodb-buffer-pool-size=256M
# - --performance-schema=OFF
# - --disable-log-bin
# - --slow-query-log=ON # 慢查询落 ./mysqldata/<host>-slow.log
# - --long-query-time=1
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:?先把 DB_ROOT_PASSWORD 写进 .env}
MYSQL_DATABASE: bepusdt