import pandas as pd
import cr_Oracle as cx
conn = cx.connect("aa", "123456", "ip:1521/test")
account = pd.read_sql(sql="select STOCK_ACCOUNT, UAP_ACCOUNT from account", con=conn)
print(account.head())
这条查询语句需要130秒,太慢了,怎么优化加快read_sql的查询速度?
是sql查询慢,还是建连接,返回数据慢呢,单单去数据库执行下查询语句看多久,查询慢的话可以通过加索引,分区分表等来提高查询速度