Re: Why is this doing a seq scan?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Ingram, Bryan" <BIngram(at)sixtyfootspider(dot)com>
Cc: "'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Why is this doing a seq scan?
Date: 2000-11-17 21:39:53
Message-ID: 14140.974497193@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Ingram, Bryan" <BIngram(at)sixtyfootspider(dot)com> 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message clayton cottingham 2000-11-17 21:45:37 Re: is there a mysql to postgresql sql converter?
Previous Message Max Fonin 2000-11-17 21:17:34 Re: is there a mysql to postgresql sql converter?