I noticed that when you use python sqlanydb module on a WAN (when the server is in a different datacenter), the sqlanydb module is very slow : it can take 16-30 seconds to fetch 1000 rows. Looks like the prefetching does not work. dbisql works fine with the same query and connection.
From a WAN :
$ time ./test.py real 0m20.118s user 0m0.112s sys 0m0.043s
From the same LAN :
real 0m0.168s user 0m0.081s sys 0m0.050s
Test case test.py:
def connect(): print "Before connecting"
c = connect()
cursor = c.cursor() query = """ select top 1000 foo from dbo.bar"""
cursor.execute(query) print "Executed"
results = cursor.fetchall() print "Fetched all"
for r in results: print r
Will raise this to the github project as well. We are SAP customers btw.
This question is marked "community wiki".
asked 03 Aug '16, 18:20
The problem comes from this IQ server option : prefetch
You need to set it to default 'Always'. The value 'Conditional' caused the issue.
answered 09 Aug '16, 07:17