Reputation: 1135
I have setup my cx_Oracle connection as follows:
cursor = conn.cursor()
cursor.execute("ALTER SESSION SET \"_PARALLEL_CLUSTER_CACHE_POLICY\" =ADAPTIVE")
followed by
df_plcy_trm = pd.read_sql_query(query_plcy_trm, conn)
However, the query does not seem to be running in parallel. The query runs much faster natively in Oracle than through cx_Oracle connection. Please advise.
Upvotes: 0
Views: 891
Reputation: 31676
Alternatively You can execute your query parallelly using the PARALLEL
Hint as follows.
query_plcy_trm = """SELECT /*+ PARALLEL */ ename, dname FROM emp e, dept d WHERE e.deptno=d.deptno""";
df_plcy_trm = pd.read_sql_query(query_plcy_trm, conn)
Upvotes: 2