On 22/02/10 17:10, River Tarnell wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Peter Körner:
>>> Has the table been ANALYZEd since it was imported?
>>
>> Only if
>> the osm2pgsql tool did it. It contains a function, pgsql_analyze, for
>> this, but I'm unsure if it got / when it gets called.
>
> osm_mapnik=# explain analyze select id from planet_osm_ways where pending;
>                                                             QUERY PLAN
> - 
> --------------------------------------------------------------------------------------------------------------------------------
>   Seq Scan on planet_osm_ways  (cost=0.00..1662990.31 rows=22160666 width=4) 
> (actual time=496448.422..496448.422 rows=0 loops=1)
>     Filter: pending
>   Total runtime: 496448.455 ms
>
> This suggests that the table statistics are very out of date (22m rows
> expected vs 0 actual).  I suggest ANALYZEing the table and trying the
> diff import again.

Osm2PgSql should do an analyze during initial import, though not during diff 
imports. From those numbers it looks like (I'd need to check the code) the 
analyze was done between the import part and the going over pending ways part, 
which would explain the high number of pending ways it expects to see. At the 
end of going over pending ways, I presume there shouldn't be any pending ways 
left, which is why you would see an actual cost of 0. The diff imports (which 
create and then clear pending ways again) are presumably run in a transaction, 
so you can't see these with a simple query outside the transaction (which may 
well have distorted my testing too) . But a minutely diff shouldn't be close to 
22m rows.

It is worth running another analyze though to see if that helps.

Kai


>
>       - river.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (HP-UX)
>
> iEYEARECAAYFAkuCuqIACgkQIXd7fCuc5vLX/ACcCKAfD+/X197OOMOikdylNunG
> Q2oAnAsOHcVefUENUEjGd1lzEtd1l0nR
> =o2RI
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Maps-l mailing list
> [email protected]
> https://lists.wikimedia.org/mailman/listinfo/maps-l


_______________________________________________
Maps-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/maps-l

Reply via email to