Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#4628 closed enhancement (fixed)

Add an option to disable ANALYZE when loading shapefiles

Reported by: gravitystorm Owned by: pramsey
Priority: low Milestone: PostGIS 3.2.0
Component: postgis Version: 2.5.x -- EOL
Keywords: Cc:

Description

After r13832 (ticket #2562) sh2pgsql automatically runs ANALYZE after loading a shapefile. This is a great default, but can cause problems when loading tens of thousands of shapefiles (e.g. from DEM processing) since the ANALYZE is run over and over again unnecessarily.

It would be nice to have an option to disable the ANALYZE in situations where you know you will be adding shapefiles repeatedly to the same table.

A workaround is to edit the output from shp2pgsql and remove the ANALYZE statement.

Change History (5)

comment:1 by robe, 5 years ago

Milestone: PostGIS 2.5.4PostGIS 3.1.0

comment:2 by pramsey, 4 years ago

Milestone: PostGIS 3.1.0PostGIS Fund Me

comment:3 by stefanpetrea, 4 years ago

Hi,

Please review this branch for this ticket.

The branch linked to below adds a new flag called -Z . When used, this flag will prevent the generation of ANALYZE statements. Without the -Z flag (default behaviour), the ANALYZE statements will be generated.

https://github.com/wsdookadr/postgis/tree/2045-analyze-z-flag

The pull request is here

https://github.com/postgis/postgis/pull/610

Best regards, Stefan

comment:4 by Regina Obe <lr@…>, 4 years ago

Resolution: fixed
Status: newclosed

In c9a654c/git:

shp2pgsql option to disable ANALYZE. Closes #4628 Closes https://github.com/postgis/postgis/pull/610 for PostGIS 3.2.0

comment:5 by robe, 4 years ago

Milestone: PostGIS Fund MePostGIS 3.2.0
Note: See TracTickets for help on using tickets.