## 关键索引设计

- **DDS-Section**: 10.2 关键索引设计
- **DDS-Lines**: L1296-L1310

### Extract

| 表名 | 索引名 | 索引列 | 用途 |
|------|--------|--------|------|
| `transactions` | `idx_txn_platform_record` | `source_platform, source_record_id` | 严格去重判定键 1 |
| `transactions` | `idx_txn_fingerprint` | `row_fingerprint` | 严格去重判定键 2 |
| `transactions` | `idx_txn_batch` | `batch_id` | 批次查询 |
| `transactions` | `idx_txn_trade_time` | `trade_time` | 模糊去重时间分桶 |
| `transactions` | `idx_txn_order` | `order_id` | 订单号匹配 |
| `transactions` | `idx_txn_status` | `status` | 状态过滤 |
| `source_files` | `idx_sf_hash` | `file_hash` | 文件重复上传拦截 |
| `raw_records` | `idx_rr_fingerprint` | `row_fingerprint` | 行级去重 |
| `rules` | `idx_rule_type_priority` | `rule_type, priority` | 规则执行顺序 |
| `dedup_relations` | `idx_dedup_src` | `src_transaction_id` | 去重关系查询 |

#### 性能说明

- `idx_txn_platform_record` 是严格去重最频繁命中的索引，组合索引比两个单列索引效率更高
- `idx_txn_trade_time` 用于模糊去重的时间分桶，避免全表 O(N²) 扫描
- `idx_rule_type_priority` 确保规则按类型分组、按优先级有序加载
