[osmosis-dev] Bad PostgreSQL plans with pgsnapshot

Brett Henderson brett at bretth.com
Tue Apr 16 11:59:16 UTC 2013


Hi Paul,

Thanks for the info.  I ran into similar issues when implementing the
Osmosis tasks.

Osmosis contains the following code that runs prior to querying for a
bounding box (ie. --dataset-bounding-box).

// PostgreSQL sometimes incorrectly chooses to perform full table scans,
these options
// prevent this. Note that this is not recommended practice according to
documentation
// but fixing this would require modifying the table statistics gathering
// configuration to produce better plans.
jdbcTemplate.update("SET enable_seqscan = false");
jdbcTemplate.update("SET enable_mergejoin = false");
jdbcTemplate.update("SET enable_hashjoin = false");

Adding those statements was a bit of a hack, but at the time I couldn't get
PostgreSQL to behave properly without them.  Perhaps they'd be unnecessary
with the bugfixes in 9.3.  Unfortunately benchmarking it again is such a
time consuming process.

Brett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/osmosis-dev/attachments/20130416/cc83ea67/attachment.html>


More information about the osmosis-dev mailing list