Opened 6 years ago

Closed 6 years ago

#4272 closed enhancement (fixed)

Improve "unable to compute statistics" notice message

Reported by: Algunenano Owned by: Algunenano
Priority: medium Milestone: PostGIS 3.0.0
Component: postgis Version: master
Keywords: Cc:

Description

Getting this when running analyze doesn't really tell me anything:

gis=# analyze;
NOTICE:  no non-null/empty features, unable to compute statistics
NOTICE:  no non-null/empty features, unable to compute statistics
NOTICE:  no non-null/empty features, unable to compute statistics
NOTICE:  no non-null/empty features, unable to compute statistics

Things I think could be improved:

  • Clarify that this is a PostGIS message.
  • If possible, indicate which schema.table and column was analyzed.
  • Indicate which mode failed (2-D, N-D)

Change History (3)

comment:1 by pramsey, 6 years ago

Approach sounds fine to me. I my (lame) defence, I didn't expect people to see that message very often :)

comment:2 by Algunenano, 6 years ago

Github PR: https://github.com/postgis/postgis/pull/364

It does 2 things:

  • Outputs table and geometry name when the error occurs.
  • Doesn't call compute_gserialized_stats_mode the second time (for N dimensions) if the first one (for just 2 dimensions) failed.

Before:

# analyze;
NOTICE:  no non-null/empty features, unable to compute statistics
NOTICE:  no non-null/empty features, unable to compute statistics
NOTICE:  no non-null/empty features, unable to compute statistics
NOTICE:  no non-null/empty features, unable to compute statistics
NOTICE:  no non-null/empty features, unable to compute statistics
NOTICE:  no non-null/empty features, unable to compute statistics
NOTICE:  no non-null/empty features, unable to compute statistics
NOTICE:  no non-null/empty features, unable to compute statistics
ANALYZE

After (as n-d isn't called there are half the log messages):

# analyze;
NOTICE:  PostGIS: Unable to compute statistics for "krakow_final.the_geom": No non-null/empty features
NOTICE:  PostGIS: Unable to compute statistics for "krakow_final.the_geom_webmercator": No non-null/empty features
NOTICE:  PostGIS: Unable to compute statistics for "lion_nyc_streets_lat_lon_enumerated_wkt.the_geom": No non-null/empty features
NOTICE:  PostGIS: Unable to compute statistics for "lion_nyc_streets_lat_lon_enumerated_wkt.the_geom_webmercator": No non-null/empty features
ANALYZE

Since I expect that someone might be relying on the log string to not change between minor releases I'm not planning on backporting this.

comment:3 by Raul Marin, 6 years ago

Resolution: fixed
Status: assignedclosed

In 17191:

Improve notice message when unable to compute stats

Closes #4272
Closes https://github.com/postgis/postgis/pull/364

Note: See TracTickets for help on using tickets.