feat: 实现父表索引策略,确保仅在父表创建索引,避免子表重复索引维护
This commit is contained in:
@@ -38,7 +38,9 @@ ALTER TABLE rcu_action.rcu_action_events
|
||||
ALTER TABLE rcu_action.rcu_action_events
|
||||
ADD COLUMN IF NOT EXISTS loop_name VARCHAR(255);
|
||||
|
||||
-- Indexes for performance
|
||||
-- Indexes for performance (ONLY on parent partitioned table)
|
||||
-- PostgreSQL will create/attach corresponding child-partition indexes automatically.
|
||||
-- Do not create duplicated indexes on partition child tables.
|
||||
CREATE INDEX IF NOT EXISTS idx_rcu_action_hotel_id ON rcu_action.rcu_action_events (hotel_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_rcu_action_room_id ON rcu_action.rcu_action_events (room_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_rcu_action_device_id ON rcu_action.rcu_action_events (device_id);
|
||||
|
||||
Reference in New Issue
Block a user