Modify the pgsnapshot load script to more sensible defaults.

If you've got a large enough file to use --wpd you really should be using osmosis to build linestrings and bboxes if you require them.
Use ALTER TABLE ... CLUSTER ON statements to set what index to CLUSTER on.

This way it gets set even if the DB is not immediately CLUSTERed and the entire database can be re-CLUSTERed with just CLUSTER;

Note: CLUSTERing nodes on a full-planet database probably isn't practical.
Disable synchronous_commit for pgsnapshot loading
Manually set some statistics for way_nodes and relation_members

Postgresql gets counts of distinct values horribly wrong for these tables.
This sometimes leads to very bad query plans, particularly for antijoin patterns

Because we have access to taginfo and know more about the data, we can do better.

Values that are likely to scale with the size of the database are set to do so.

Other values, like the maximum number of nodes in a way, are fixed based on current
data.
Update list of expected schema migrations
Merge remote-tracking branch 'upstream/master' into owldb-plugin
Merge remote-tracking branch 'tomh/migrations'
Fix remaining 64-bit id tracking problems

The BitSetIdTracker was still being used in a number of places.  All
instances have now been replaced by the 64-bit capable DynamicIdTracker.
Increase maximum way node count from 16-bit to 32-bit

The Storeable implementation for Way was representing the number of way
nodes as a Character.  This is sufficient for most purposes (ie. API
data) but some third-party tools can create very long ways.  This size
increase adds a small overhead to persistence, but should be largely
unnoticeable.
replication: Fix null pointer exception in --merge-replication-files

The --merge-replication-files task was failing to initialise its current
data state during startup.  This breakage was introduced while
externalising code into the new ReplicationStore implementation.  This
change fixes the initialisation code to use the replication store to
load state instead of directly loading it.
Merge branch 'master' of https://github.com/openstreetmap/osmosis into owldb-plugin