Add important index
This commit is contained in:
		
							parent
							
								
									9bc12ab6d7
								
							
						
					
					
						commit
						4bc2eba8a2
					
				@ -28,6 +28,7 @@ CREATE TABLE IF NOT EXISTS entity_alarm (
 | 
			
		||||
 | 
			
		||||
CREATE INDEX IF NOT EXISTS idx_alarm_tenant_status_created_time ON alarm(tenant_id, status, created_time DESC);
 | 
			
		||||
CREATE INDEX IF NOT EXISTS idx_entity_alarm_created_time ON entity_alarm(tenant_id, entity_id, created_time DESC);
 | 
			
		||||
CREATE INDEX IF NOT EXISTS idx_entity_alarm_alarm_id ON entity_alarm(alarm_id);
 | 
			
		||||
 | 
			
		||||
INSERT INTO entity_alarm(tenant_id, entity_type, entity_id, created_time, alarm_type, customer_id, alarm_id)
 | 
			
		||||
SELECT tenant_id,
 | 
			
		||||
 | 
			
		||||
@ -81,5 +81,4 @@ public interface RuleChainDao extends Dao<RuleChain>, TenantEntityDao {
 | 
			
		||||
 | 
			
		||||
    Collection<RuleChain> findByTenantIdAndTypeAndName(TenantId tenantId, RuleChainType type, String name);
 | 
			
		||||
 | 
			
		||||
    List<RuleChainOutputLabelsUsage> getOutputLabelUsage(UUID id, UUID id1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -105,11 +105,6 @@ public class JpaRuleChainDao extends JpaAbstractSearchTextDao<RuleChainEntity, R
 | 
			
		||||
        return DaoUtil.convertDataList(ruleChainRepository.findByTenantIdAndTypeAndName(tenantId.getId(), type, name));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<RuleChainOutputLabelsUsage> getOutputLabelUsage(UUID tenantId, UUID ruleChainId) {
 | 
			
		||||
        return null;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public Long countByTenantId(TenantId tenantId) {
 | 
			
		||||
        return ruleChainRepository.countByTenantId(tenantId.getId());
 | 
			
		||||
 | 
			
		||||
@ -26,6 +26,8 @@ CREATE INDEX IF NOT EXISTS idx_alarm_tenant_alarm_type_created_time ON alarm(ten
 | 
			
		||||
 | 
			
		||||
CREATE INDEX IF NOT EXISTS idx_entity_alarm_created_time ON entity_alarm(tenant_id, entity_id, created_time DESC);
 | 
			
		||||
 | 
			
		||||
CREATE INDEX IF NOT EXISTS idx_entity_alarm_alarm_id ON entity_alarm(alarm_id);
 | 
			
		||||
 | 
			
		||||
CREATE INDEX IF NOT EXISTS idx_relation_to_id ON relation(relation_type_group, to_type, to_id);
 | 
			
		||||
 | 
			
		||||
CREATE INDEX IF NOT EXISTS idx_relation_from_id ON relation(relation_type_group, from_type, from_id);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user