[gdal-dev] Problems with MySQL queries in GDAL

Even Rouault even.rouault at spatialys.com
Wed May 6 09:54:14 PDT 2015


Le mercredi 06 mai 2015 18:48:39, Pavol Hnila a écrit :
> My impression is that all layers are queried for each record/row in the
> table that needs to be shown. If I have 34 rows in my layer and it is a
> single layer, there will be 34 queries. If I have 80 tables in the same
> database and I want to show those 34 rows of one table/layer, then there
> will be 34x80 queries. But why?

I've instrumented the mysql driver to emit a debug trace each time DESCRIBE is 
issued. The result is that all spatial layers are DESCRIBEd one and only once 
for each dataset opening.
If you see DESCRIBE for a same layer showing several times, then it means that 
QGIS is opening/closing the OGR dataset many times. Which would be conformant 
to the issue I noticed some time ago.

> 
> Pavol
> 
> ---- Even Rouault schrieb ----
> 
> >Le mercredi 06 mai 2015 18:15:11, Pavol Hnila a écrit :
> >> Even,
> >> 
> >> Thank you very much for your reply. I have actually also tried with
> >> OSGeo4W command line tool for Windows 7, using "ogrinfo mysql:...
> >> tablename" syntax. The result in mysql log file seems to be the same as
> >> with Qgis, so I concluded that the reason must be gdal.
> >
> >I guess you just a DESCRIBE for each layer, but not multiple times for a
> >given layer ?
> >I assumed this was the problem you had (multiple DESCRIBE for a given
> >layer) given the logs you showed.
> >
> >If your issue is rather that at dataset opening all layers are queried
> >with DESCRIBE, then yes this is expected from the current state of the
> >mysql driver. That could potentially be improved.
> >
> >Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list