我目前正在通过pandas.io.sql.read_sql()
命令将数据查询到数据框中。我希望将这些调用的并行化方式类似于这些人所倡导的:(Embarrassingly parallel database calls with Python (PyData Paris 2015 ))
像(非常一般)的东西:
pools = [ThreadedConnectionPool(1,20,dsn=d) for d in dsns]
connections = [pool.getconn() for pool in pools]
parallel_connection = ParallelConnection(connections)
pandas_cursor = parallel_connection.cursor()
pandas_cursor.execute(my_query)
这样的事情可能吗?