[osmosis-dev] pgsnapshot composite index results
Frederik Ramm
frederik at remote.org
Tue Jan 22 18:57:03 GMT 2013
Hi,
On 22.01.2013 11:17, Paweł Paprota wrote:
> So every WMS map request generates something like this:
>
> SELECT "type",encode(ST_AsBinary(ST_Force_2D("way")),'base64') as "way"
> FROM "public"."view_railways" WHERE ("way" && ST_GeomFromText('POLYGON
> ((2031543.337480622 6414748.28685562, 2031543.337480622
> 6578323.527363132, 2195118.5779881305 6578323.527
> 363132, 2195118.5779881305 6414748.28685562, 2031543.337480622
> 6414748.28685562))', 900913) AND "type" = 'rail')
Such requests are ideally served by a conditional index (i.e. when you
create the index with a "WHERE type=rail" clause). Since your WMS is
probably not running custom queries, you can pre-create these indexes
and they're not even terribly expensive to create. Having a large number
of them slows down updates but having them for the 5-10 most
time-consuming SELECTs is certainly worth it.
Bye
Frederik
--
Frederik Ramm ## eMail frederik at remote.org ## N49°00'09" E008°23'33"
More information about the osmosis-dev
mailing list