>> Are you suggesting that I: >> a. use a different datatype in plpgsql or >> b. cast the values or >> c. change the data type in the table > >Yes ;-). Presumably (b) would be the least painful route, but any of >these would do the trick.
It turns out that the text and char(5) were not the problem - it was an integer field that was passed into the function as a text (the proximity field)! It now utilizes the index and has gone from taking over 7 seconds to complete to .011 seconds! I love postgres! Thanks Tom! -r ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly