Ticket #1474 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

PostGIS fetches 1 at a time

Reported by: pramsey@… Owned by: mloskot
Priority: highest Milestone: 1.4.1
Component: OGR_SF Version: 1.4.0
Severity: normal Keywords:
Cc:

Description (last modified by mloskot) (diff)

In ogrpglayer.cpp a CURSOR is prepared and features are fetched, but they are only fetched one at a time (#define CURSOR_PAGE 1). This is optimally memory efficient, but very database inefficient. A few hundred or thousand at a time would work better.

Change History

Changed 5 years ago by warmerdam

Reassign to Mateusz

I'd like this fixed in 1.4 branch as well as trunk.

Changed 5 years ago by mloskot

I reviewed this issue and run tests on big datasets (~500K of features), using index or not, etc.
I compared timing logged by PostgreSQL for various CURSOR_PAGE values:
1, 100, 250, 500 and decided to set the value page to 500 tuples.

Detailed changeset:
http://trac.osgeo.org/gdal/changeset/10871

I resolve it as FIXED.

Changed 5 years ago by warmerdam

Mateusz, 

It doesn't seem from this report that the fix was also applied to the
1.4.x branch, but it should be.  Please be specific about where changes
are made in the bug reports. 

Changed 5 years ago by mloskot

Frank,

Yes, I forget to apply it to the 1.4.
I just backported these changes to the branches/1.4, here is the changeset:

http://trac.osgeo.org/gdal/changeset/10874

I'll follow your suggestions.

Changed 5 years ago by hobu

  • description modified (diff)
  • milestone set to 1.4.1

Changed 5 years ago by mloskot

  • description modified (diff)
Note: See TracTickets for help on using tickets.