[PyGreSQL] pygresql connection speeds issue
Hagop Narsesian
hagopnarsesian at yahoo.com
Sat Apr 21 06:29:33 EDT 2007
Hello all,
I'm quite new to pygresql and very new to the list.
I am using pygresql for python 2.4 to connect to my
postgresql 8.2 db. I normally open the connection only
for the duration of the action I require, and then
close it again. When I perform inserts or deletes, the
process is quick. But when I have to carry out a
select query, it can take up to 6 or 7 seconds, even
for queries from tables that are no larger than 60 or
70 rows and that are indexed.
Initially I thought this was because of the overheads
of the connection, but in this event, inserts should
also take very long, shouldn't they?
I carry out some basic validations and formatting
after fetching the query, but I'm pretty sure this
can't be taking up the time, as it remains slow even
when I fetch a single row, and it doesn't seem to
matter too much whether it's 1 row 150, and I rarely
fetch any more than about 150.
Anyone have any suggestions? Should I be keeping
connections open all the time?
Hagop
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the PyGreSQL
mailing list