[Qgis-developer] Problem with the MySQL/GDAL implementation in QGIS

Pavol Hnila pavol.hnila at fu-berlin.de
Sat May 9 07:58:59 PDT 2015


Thank you, Jürgen.

> PostgreSQL-Users probably don't use OGR to access the database -
> same for SpatiaLite, Oracle or MSSQL users.
Right - there are no problems when connecting with the native QGIS
provider for PostgreSQL. What are the chances that MySQL also gets
native QGIS support that bypasses OGR?

> QGIS does multithreaded rendering and because OGR layers are not
> thread safe the OGR provider always reopens the layer on every
> rendering run.  Apparently that's not too expensive for file based
> data sources, which I think the OGR provider is mostly used for.
The described OGR problem emerged with QGIS 2.0. Was that version
already influenced with multithreaded rendering? Anyway, it is not
only that the OGR provider reopens the layer on every rendering run.
It is instructed by QGIS to reopen SEPARATELY every record of that
layer and query it with all tables in the database on every rendering
run. So instead of simple "connect->select * from table...->quit" the
server will be flooded with literally thousands of reopenings that
cause QGIS to freeze for minutes (queries = number of records in the
table multiplied by number of tables in the database). I am not sure
what part of this behavior is intended in order to make the OGR
provider thread-safe and what is a bug? I can get rid of the
unnecessary querries of all tables with manually modifying the layer
connection settings in the .qgs file. But I do not know how to get rid
of reopenings for each record separately. Shall I file a ticket?

Pavol


More information about the Qgis-developer mailing list