<div dir="ltr">On Tue, Sep 9, 2008 at 4:01 AM, Florian Lohoff <span dir="ltr"><<a href="mailto:flo@rfc822.org">flo@rfc822.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Mon, Sep 08, 2008 at 08:05:56AM -0500, Ian Dees wrote:<br>
> Subject: Re: [OSM-dev] osmosis pgsql schema / way.bbox removal/option<br>
</div><div class="Ih2E3d">> On Mon, Sep 8, 2008 at 7:29 AM, Jochen Topf <<a href="mailto:jochen@remote.org">jochen@remote.org</a>> wrote:<br>
><br>
> ><br>
> > I use the --write-pgsql-dump which creates files which can then be<br>
> > imported using COPY. If you use it that way, Osmosis doesn't do any<br>
> > extra postprocessing like the bbox thing.<br>
> ><br>
><br>
> It's important to use the spatial keys for at least the points, as this<br>
> significantly improves query times. If you don't, Postgres will have to go<br>
> through all 260M rows in the database to return meaningful data.<br>
<br>
</div>I have those running and they work like a charm. I am right playing<br>
around with implementing all the tricky things in the database with temp<br>
tables to be able to really stream all or most of the xml instead of<br>
pulling the data together in perl. Concerning the simple scheme. Its<br>
also missing an index on the way_nodes table for the way_id but thats<br>
just peanuts.<br>
<div class="Ih2E3d"><br>
> On Mon, Sep 08, 2008 at 11:58:18AM +0200, Florian Lohoff wrote:<br>
> > i was trying to use the postgresql simple schema from osmosis to import<br>
> > a planet and after 5 days i aborted the import. 4 of the 5 days the<br>
> > postgresql was busy building the bboxes for the ways.<br>
><br>
> Florian, my version of ROMA was doing this, too. I ended up stopping the<br>
> import after 6 days of indexing. It would make things run so much faster<br>
> (and allow us to retrieve all the ways in a bounding box, even the ones that<br>
> don't have nodes in the bounding box), but it's not worth the extra planet<br>
> import time I think. At least when I'm paying USD$0.10/hour for it...<br>
<br>
</div>Okay - dropping the bbox on the ways which are useless for us you can do<br>
the import in 1200 minutes - at least on my hardware.<br>
<div><div></div><div class="Wj3C7c"></div></div></blockquote><div><br></div></div>As Jochen mentioned, the --write-pgsql-dump task and subsequent import using COPY statements should be faster.  I've looked at getting osmosis to stream data directly into the database but unfortunately jdbc drivers don't expose that kind of functionality.<br>
<br>I'll take a look at this bbox thing.  Perhaps I can get osmosis to query the database to see if the bounding box column exists and only populate it if it does ...<br><br>Right now I'm playing with code to manually populate the bbox column during an import using a memory mapped file containing node lat/lon values but if nobody needs the column I'm probably wasting my time.<br>
<br>I intend to make all of these changes in the API 0.6 version though, not sure if that's an issue.<br><br></div>