New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
planet_osm_ways_idx partial index comes out amazingly bloated #105
Comments
8kB is suspiciously small |
There are no pending ways after an import is completed. You only get them during updates. |
Yes, the index is needed during diff imports. At the end of each run of osm2pgsql there shouldn't be any pending ways left though. So 8kb sounds about right at then end of a osm2pgsql run. The index is also used during the "going over pending ways" stage of the initial import, for which there is a very large number of pending ways. But given that, it might be better to only create that index after the end of pending ways and rely on a seq scan for the pending ways query during initial import. |
If you're going over more than 1-5% of the table, a seq scan will generally be used over an index scan. It sounds like deferring its creation until the end is the best option, and of course not creating it if we're doing --drop |
Full stats, just for reference
|
I'm unsure if that is related of if I should open a new issue, but that might be related to the behaviour I reported in 03/2012 here : https://lists.openstreetmap.org/pipermail/dev/2012-March/024589.html summary : To solve the problem post import, I did a re-index (reindex index planet_osm_ways_idx;) and the same query now run in less than 10ms I did a planet import with osm2pgsql version from commit Sat Oct 19 20:31:04 2013 -0600 (Increment version to 0.85.0 to development version) If osm2pgsql arguments might matter, I can provide them |
Also increments the version to 0.87.0 Closes osm2pgsql-dev#187 Fixes osm2pgsql-dev#156 Fixes osm2pgsql-dev#186 Fixes osm2pgsql-dev#105 Fixes osm2pgsql-dev#111
"planet_osm_rels_idx"
is thebtree (id) WHERE pending
index.On a fresh import this comes out as 3634 MB. A reindex brings this down to 8 kB. This is obviously absurdly bloated. We should either reindex at the end, or defer index creation until after pending ways if possible.
The text was updated successfully, but these errors were encountered: