Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #102940
| X-Received | by 10.129.27.3 with SMTP id b3mr14388469ywb.0.1455516467629; Sun, 14 Feb 2016 22:07:47 -0800 (PST) |
|---|---|
| X-Received | by 10.50.26.35 with SMTP id i3mr116426igg.7.1455516467602; Sun, 14 Feb 2016 22:07:47 -0800 (PST) |
| Path | csiph.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!y89no1723629qge.0!news-out.google.com!kr2ni5089igb.0!nntp.google.com!hb3no4870440igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
| Newsgroups | comp.lang.python |
| Date | Sun, 14 Feb 2016 22:07:47 -0800 (PST) |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=198.147.160.75; posting-account=B9mXiwoAAABRuGiBDGsy79JZ_3g-Eu8L |
| NNTP-Posting-Host | 198.147.160.75 |
| User-Agent | G2/1.0 |
| MIME-Version | 1.0 |
| Message-ID | <f27cefdf-ead3-4331-9a98-d3a5793a6fae@googlegroups.com> (permalink) |
| Subject | fetchall is taking much longer time while getting data from Sybase module in Python |
| From | reetesh nigam <nigamreetesh84@gmail.com> |
| Injection-Date | Mon, 15 Feb 2016 06:07:47 +0000 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-Received-Bytes | 1909 |
| X-Received-Body-CRC | 1747207559 |
| Xref | csiph.com comp.lang.python:102940 |
Show key headers only | View raw
Hi All,
I am retrieving data from Sybase database using Sybase module of Python.
My query is not taking time however fecthall is taking longer time.
Below is the test script :
def run_query(db,query): ## Run query and resturn record result
t1 = datetime.now()
cursorObj = db.cursor()
t2 = datetime.now()
cursorObj.execute(query)
t3 = datetime.now()
import pdb
pdb.set_trace()
rowset = cursorObj.fetchall()
t4 = datetime.now()
cursorObj.close()
print "Time taken to make cursor --%s"%(t2-t1)
print "Time taken to execute query --%s"%(t3-t2)
print "Time taken for fetchall--%s"%(t4-t3)
return rowset
Output:
Time taken to make cursor --0:00:00.000037
Time taken to execute query --0:00:00.379443
Time taken for fetchall--0:00:14.739064
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
fetchall is taking much longer time while getting data from Sybase module in Python reetesh nigam <nigamreetesh84@gmail.com> - 2016-02-14 22:07 -0800 Re: fetchall is taking much longer time while getting data from Sybase module in Python Peter Otten <__peter__@web.de> - 2016-02-15 10:25 +0100
csiph-web