Bad perf when using DECLARE CURSOR on big table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi list !

I have a simple but big spatial table with approx 93 000 000 lines.

I use QGIS, the open-source GIS software to display this data. To fetch the polygons to draw on QGIS map, QGIS launch a first DECLARE CURSOR query, then fetch data 2000 by 2000.

I have seen that this DECLARE has bad perf compared to a simple SQL query :

Simple SQL query
=====
96ms

DECLARE CURSOR for the same query
=====
171 031 ms !!


Do you have any clue about this query plan ? Should I add some table specific weight, stats, etc. to help the DECLARE clause to use the indexes as done for the simple SELECT ?

Regards
Michaël


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux