[Tile-serving] [osm2pgsql] planet_osm_ways coming out bloated (#111)

Paul Norman notifications at github.com
Tue Dec 17 11:34:31 UTC 2013


[`pgstattuple`](http://www.postgresql.org/docs/9.3/static/pgstattuple.html) is a PostgreSQL extension that allows you to get various tuple-level statistics for a table.

This allows me to see, for example, that the `planet_osm_ways` table comes out of the import substantially larger than ideal.

```
gis=# SELECT pg_size_pretty(table_len) AS table_len, tuple_count, pg_size_pretty(tuple_len) AS tuple_len, tuple_percent, dead_tuple_count, pg_size_pretty(dead_tuple_len) AS dead_tuple_len, dead_tuple_percent, pg_size_pretty(free_space) AS free_space, free_percent FROM pgstattuple('planet_osm_polygon');

-[ RECORD 1 ]------+----------
table_len          | 66 GB
tuple_count        | 196145030
tuple_len          | 39 GB
tuple_percent      | 59.77
dead_tuple_count   | 217468
dead_tuple_len     | 55 MB
dead_tuple_percent | 0.08
free_space         | 24 GB
free_percent       | 36.94
```

What this means is that the table is currently 66GB on disk, but after a `VACUUM FULL` or `CLUSTER` would be 39GB

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/111
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20131217/2cb411e6/attachment.html>


More information about the Tile-serving mailing list