3

In our project we have been using QGIS 1.8 Lisboa with a MySQL database placed on a server accessed via local network since two years. Everything is working fine and quick. The vector layers can be edited very swiftly, even when the MySQL server is on internet.

Since the change to QGIS 2.0 this is no more the case (the same applies to 2.2, 2.4, 2.6 and 2.8). Even a simple vector layer of 10 features takes a long time to open. It is not a question of rendering. The response time is extremely long even when opening the attribute table values). Naturally, the more features there are, the longer it takes. We were actually forced to continue using 1.8 for editing and we use 2.6 only for printing. It should be noted that we are using 1.8 and 2.6 as parallel installations on the same computers now, and the difference in speed is enormous (c. 1-3 seconds response time for a simple table on QGIS 1.8 and c. 20 seconds on QGIS 2.6). We have computers running Windows 7, Windows 8, Linux Ubuntu 14.04. The operating system has no effect on the speed.

Any ideas?

Switching between two versions is very cumbersome for our workflow (but still much quicker than working with 2.6 only).

Actualization (30th April 2015): The problem is not related with network. I have made additional tests with localhost, and the results show the same pattern. The old 1.8 version is immediate in its response time, while the 2+ versions take a very long response time. I have however observed an additional, highly remarkable fact - the speed of the QGIS 2.0-2.8 versions is related to the number of tables in the MySQL database!!! If there is only a single table (with 34 simple polygon records), opening its attribute table in QGIS 2.6.1 takes 2-3 seconds. It is not immediate like QGIS 1.8, but it is pretty quick. Now, if I leave this simple polygon layer opened in QGIS 2.6.1 and I add another tables with spatial information into the MySQL database (yet I do not load them in QGIS, they remain only present in the database), the time necessary to open the attribute table of that simple polygon layer will increase (even if the polygon layer is still the only one layer loaded in QGIS)!!! With 4 tables it takes 5 seconds to open the attribute table, with 9 tables it takes 10 seconds, with 81 tables it takes more than 70 seconds to open an attribute table of a single loaded layer. I just do not understand why this happens only by QGIS 2 and higher??? QGIS 1.8 is in no way influenced by the number of MySQL tables. Can be related with GDAL-tools??? I cannot believe we are the only project that has this problem. Can someone replicate this QGIS/MySQL behaviour? Our configuration of MySQL: version 5.6.21, the tables use MyISAM database engine.

closed as off-topic by PolyGeo Mar 25 '17 at 5:42

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This problem cannot or can no longer be reproduced. Changes to the system or to the asker's circumstances may have rendered the question obsolete, or the question does not include a procedure to enable potential answerers to reproduce the same symptoms. Such questions are off-topic as they are unlikely to help future readers, but editing them to include more details can lead to re-opening." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    I just tested with a (non-spatial) mysql server running on localhost with 2.8.1 and could not see any slow-down regardless of the number of tables. To assess the problem you may enable the query log on your server to see what actually happens. – Matthias Kuhn Apr 30 '15 at 15:05
  • Thank you Matthias, this was a great comment. The query log shows huge differences. I have uploaded them here: – Pavol Apr 30 '15 at 16:11
  • Can someone explain me the differences in the query logs between QGIS 1.8 and 2.8 (see the link in my previous comment)? Does QGIS 2.8 try to connect to every single table with spatial information in the database? It looks to me that QGIS 2.8 generates and passes to MySQL much more complicated queries than its 1.8 predecessor. – Pavol May 5 '15 at 15:39
  • 1
    QGIS uses GDAL to access MySQL databases. It is likely that the GDAL people have more information about this topic. I would try to ask on their mailinglist lists.osgeo.org/listinfo/gdal-dev – Matthias Kuhn May 5 '15 at 15:44
  • Thanks, I will try by GDAL list. But just as a possible quick fix - is it possible to use the newest QGIS with older GDAL tools? – Pavol May 6 '15 at 8:04

Browse other questions tagged or ask your own question.