[postgis-users] Improving the timing of a function

Matthew Pulis mpulis at gmail.com
Thu Dec 6 11:31:07 PST 2007


Hi,

 

I added this function to find the nearest hospital using the distance
covered on the route itself. 

 

My reasoning was this :

-          Find the 3 most near hospitals using distance() function

-          Iterate the 3 hospitals and find the one which is the shortest
distance taking into considerations one-ways et al. using shootingstar_sp()
pgRouting Function.

 

Using Pastebin I have pasted my current function and also inline commented
more on the function

 

At the end of the paste you can find the EXPLAIN ANALYZE of the query.

 

Paste can be found here : http://yancho.pastebin.com/f3cca3a41

 

May I point out that I tried the first SELECT query without LIMIT 3 and it
gave me 52 points in 32ms and with LIMIT 3 it gave me the 3 points in 31 ms.

 

 

Any help would be extremely appreciated J

 

Thanks and regards

 

Matthew Pulis 

 

  _____  

I am using the free version of SPAMfighter for private users.
It has removed 18467 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter <http://www.spamfighter.com/len>  for free now!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20071206/045e986f/attachment.html>


More information about the postgis-users mailing list