I'm trying to dump csv files into my table using cx_Oracle and python. But it's unbearably slowly (500 records in 336 secs). Kindly let me if there's any other method faster than this. Code is below
import pandas as pd
import cx_Oracle
import time
connection_string = '{}/{}@//{}:{}/{}'.format(user_name, password, host_name, port, service_name)
engine = cx_Oracle.connect(connection_string)
start_time = time.time()
t = pd.read_sql(con=engine, sql='select * from students where rownum < 18000')
print(t.shape)
t.to_sql(con=engine, name='students_new', if_exists='append', index=False)
print("Finished in : " + str(round(time.time() - start_time, 2)))