OK I know this has been long delayed but I've finished some work on the above. The coster is actually doing a fairly good job. I only recieved one submission from someone with data that replicated the problem, and was myself hard pressed to replicate the situation. It's more-or-less a fencepost error. I don't have the expertise to figure out how to make the coster more determinate in these types of situations. However as some suggested the practice of storing actual run data from query plans (esp. when using precompiled and/or stored queries) would probably help eliminate these byt adding another weight factor (IE last time we did this it took X amount of time, and we estimated Y, so lets try it this way instead).
Unfortunately I'm a bit too pressed for time looking for a job to continue pursuing this research any further. Michael Loftis ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html