Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group