实现资产双向换货链路查询
This commit is contained in:
8
migrations/000161_add_exchange_trace_indexes.up.sql
Normal file
8
migrations/000161_add_exchange_trace_indexes.up.sql
Normal file
@@ -0,0 +1,8 @@
|
||||
-- 为已完成且未软删除的换货链双向最新记录查询增加非唯一部分索引。
|
||||
CREATE INDEX idx_exchange_trace_new_asset
|
||||
ON tb_exchange_order USING btree (new_asset_type, new_asset_id, completed_at DESC NULLS LAST, id DESC)
|
||||
WHERE status = 4 AND deleted_at IS NULL;
|
||||
|
||||
CREATE INDEX idx_exchange_trace_old_asset
|
||||
ON tb_exchange_order USING btree (old_asset_type, old_asset_id, completed_at DESC NULLS LAST, id DESC)
|
||||
WHERE status = 4 AND deleted_at IS NULL;
|
||||
Reference in New Issue
Block a user