optimization for databases without triggers