[PyQt] QSqlDatabase connection parameters
frankel at circlesfx.com
Fri Mar 19 19:06:12 GMT 2010
Would anyone have any suggestions for improving QSqlDatabase PSQL
The Qt docs refer to PSQL connection options and demonstrate the
"requiressl=1" example. Are there other options that can be set?
(eg: the docs' PostgreSQL "options" bullet point) Google searches
are coming up short.
I note that my local postgresql.conf file has a "work_mem" statement.
(Usage: work_mem = 1MB) That could be germane, but including the
term in my setConnectOptions() method (as part of a semi-colon
separated list) yields PSQL errors.
I've optimized my working code further. Running from a local data
set, launch times are down to 4 seconds. Running from an identical
data set hosted remotely, my application launches in 40+ seconds!
Thanks in advance!
On Mar 16, 2010, at 9:09 PM, Scott Frankel wrote:
> 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
> db = QtSql.QSqlDatabase.addDatabase("QPSQL")
> Thanks in advance!
> PyQt mailing list PyQt at riverbankcomputing.com
More information about the PyQt