Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#2460 closed patch (fixed)

Use estimated metadata for PostGIS layers

Reported by: jpalmer Owned by: nobody
Priority: major: does not work as expected Milestone: Version 1.5.0
Component: Data Provider Version: Trunk
Keywords: postgis, postgresql, speed Cc:
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

Description

PostGIS layers with millions of features take quite some time to be added to the map canvas because of table feature counts, layer extents and geometry type determination.

Attached is a patch that adds an option to speed up the following PostGIS layer operations:

  • The row count is determined from table statistics obtained from running the PostgreSQL table analyse function.
  • Table extents are always determined with the estimated_extent PostGIS function, even if a layer filter is applied.
  • If the table geometry type is unknown and is not exclusively taken from the geometry_columns table, then it is determined from the first 100 non-null geometry rows in the table. This applies to both the PostGIS Provider and the Add PostGIS Layers dialog.

This patch potential resolves the following tickets: #2394, #581

Attachments (1)

postgis_use_estimated_metadata.diff (17.0 KB ) - added by jpalmer 14 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 by jpalmer, 14 years ago

Type: enhancementpatch

comment:2 by jef, 14 years ago

Resolution: fixed
Status: newclosed

slightly modified applied in r13044. Thanks Jeremy.

comment:3 by jef, 14 years ago

take 2 on r13221.

Note: See TracTickets for help on using tickets.