[PyQt] QSqlDatabase connection parameters

Scott Frankel frankel at circlesfx.com
Wed Mar 17 04:09:33 GMT 2010


Hi all,

Is there a buffer size or similar optimization parameter that can be  
set for QSqlDatabase PSQL connections?  The docs refer to PostgreSQL  
"options" without specifying what they may be.

I have a PG database cluster of about 7MB, spread over a couple dozen  
tables.  Locally, it takes about 6 seconds to launch my app, loading  
the model data into my forms.

When I pull an identical data-set from a remote location, my  
application launch time increases to over 60 seconds.  Yet resource  
utilization on the remote server is miniscule.

For comparison, I'm able to download the results of a 21MB SELECT  
statement in less than 8 seconds via cmd-line psql.  That's orders of  
magnitude more data in an order of magnitude less time!

I'm creating my db connection as follows.  (Sample code attached also.)

	db = QtSql.QSqlDatabase.addDatabase("QPSQL")
	db.setDatabaseName("fubar")
	db.setHostName("localhost")
	db.setUserName("admin")
	db.setPassword("abc123")


Thanks in advance!
Scott


-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbTest.002.py
Type: text/x-python-script
Size: 3676 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100316/f9e8fc83/attachment-0001.bin>
-------------- next part --------------





More information about the PyQt mailing list