我试图使用SQLAlchemy构建一个bitemporal model,但遇到了性能问题。你知道吗
def update(new_record)
if new_record does not exist in db then
1) update existing old record with same primary key as new_record by setting validTo date as today and I am using SQLAlchemy's merge here.
2) insert new record with new validFrom and validTo dates using SQLAlchemy's add()
如果我叫这个update
大约10次,然后做commit
,需要20-25秒,这是很多。我错过了什么?在SQLAlchemy中执行合并/添加循环是不好的,如何解决这个问题?你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐