lundi 30 juillet 2018

SQLAlchemy Pandas Flask Slow

After doing some testing with Flask running a webpage, I've noticed that when I connect flask to a database using SQLAlchemy, it takes about 40s to load the page.

zengine = sqlalchemy.create_engine("oracle+cx_oracle://CONNECTION")
summary_sql = "select distinct hub, value, date_inserted from ZE_DATA.AESO_CSD_SUMMARY order by date_inserted desc fetch first 10 rows only" 
summary = pd.read_sql_query(summary_sql, zengine)

Is there a way to optimize the code or is there a better option of connecting to a database that would improve the speed?

Thanks!




Aucun commentaire:

Enregistrer un commentaire