openstreetmap/osm2pgsql — pull request #102 by pnorman (2013-11-13 20:39:35+00:00)
Title: Disable ORDER BY way "clustering"

Testing indicates that a modified pinning number is no better with
ORDER BY way than by clustered/ordered on osm_id. As the table at
this point are approximately ordered by ID, skip ordering completely.

The modified pinning number is the pinning number, but instead of a
point, an area equivalent to a rendering meta-tile.

For high zooms and a true pinning number ordering by ID is effective,
probably because typically the ways right around a point were created
at about the same time.

For low zooms, a clustering on gist (way) may be desirable, but this
is something the user will have to consider, particularly as it takes
a decent amount of time to do this clustering, and significantly
increases the disk space requirements during the import process.

Benchmarks show the pinning number is within 10% for both a full planet and an extract and the ID-ordered z12 modified pinning number is 50% of the `ORDER BY way` z12 modified pinning number for the line table and 90% for the polygon table.

@apmon, I know there's some conflicts between this and the threading branch, but this also completely eliminates a section you had to change, making the merge simpler.