Add id indexes on new partitioned tables
This commit is contained in:
		
							parent
							
								
									0c6832b2ad
								
							
						
					
					
						commit
						7dd9a491b9
					
				@ -112,6 +112,7 @@ CREATE TABLE IF NOT EXISTS edge_event (
 | 
			
		||||
    ts bigint NOT NULL
 | 
			
		||||
    ) PARTITION BY RANGE (created_time);
 | 
			
		||||
CREATE INDEX IF NOT EXISTS idx_edge_event_tenant_id_and_created_time ON edge_event(tenant_id, created_time DESC);
 | 
			
		||||
CREATE INDEX IF NOT EXISTS idx_edge_event_id ON edge_event(id);
 | 
			
		||||
 | 
			
		||||
CREATE OR REPLACE PROCEDURE migrate_edge_event(IN start_time_ms BIGINT, IN end_time_ms BIGINT, IN partition_size_ms BIGINT)
 | 
			
		||||
    LANGUAGE plpgsql AS
 | 
			
		||||
 | 
			
		||||
@ -54,6 +54,8 @@ CREATE INDEX IF NOT EXISTS idx_audit_log_id ON audit_log(id);
 | 
			
		||||
 | 
			
		||||
CREATE INDEX IF NOT EXISTS idx_edge_event_tenant_id_and_created_time ON edge_event(tenant_id, created_time DESC);
 | 
			
		||||
 | 
			
		||||
CREATE INDEX IF NOT EXISTS idx_edge_event_id ON edge_event(id);
 | 
			
		||||
 | 
			
		||||
CREATE INDEX IF NOT EXISTS idx_rpc_tenant_id_device_id ON rpc(tenant_id, device_id);
 | 
			
		||||
 | 
			
		||||
CREATE INDEX IF NOT EXISTS idx_device_external_id ON device(tenant_id, external_id);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user