"Ingram, Bryan" <[EMAIL PROTECTED]> writes:
>> Also it would be useful to see the full declarations of the tables
>> and their indexes; I'm wondering what datatype the zip columns are,
>> for example.

> Table    = atms
> | zip                              | text                             |

> Table    = zips
> | zip                              | varchar()                        |

Ah, there's your problem --- the planner is not very smart about
optimizing cross-datatype comparisons.  Make these columns both text,
or both varchar, and I'll bet you get a more intelligent plan.

Current sources (7.1-to-be) are a little smarter than 7.0 about
cross-data-type joins, but they still don't get this case right.
I have a TODO item about that, but I dunno if it'll get done before
7.1 ...

                        regards, tom lane

Reply via email to