on 2016 Aug 03 7:20 PM
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:
import sqlanydb
def connect(): print "Before connecting"
conn = sqlanydb.connect(DSN="IQ_DB",UID="foo",PWD="bar", preFetchRows="1000")
print "After connecting"
return conn
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[0]
Will raise this to the github project as well. We are SAP customers btw.
Request clarification before answering.
The problem comes from this IQ server option : prefetch
You need to set it to default 'Always'. The value 'Conditional' caused the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
52 | |
10 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.