我正在使用 pg8000 从 csv 文件更新 Azure 上我的 postgres 数据库中的数据,但执行速度非常慢,
这是我的代码
command = "INSERT INTO public.tempcumulativesales (combined, cumulative_sales) VALUES (%s, %s)"
with open('./UpdateDatabaseFiles/rows1.csv', 'r') as file:
next(file)
data = list(csv.reader(file))
cursor.executemany(command, data)
有谁知道我怎样才能提高速度?
csv 文件有 12,000 多个条目