Re: Why is this doing a seq scan?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Why is this doing a seq scan?
Дата
Msg-id 14140.974497193@sss.pgh.pa.us
обсуждение исходный текст
Ответ на RE: Why is this doing a seq scan?  ("Ingram, Bryan" <BIngram@sixtyfootspider.com>)
Ответы Re: Why is this doing a seq scan?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
"Ingram, Bryan" <BIngram@sixtyfootspider.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


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Ingram, Bryan"
Дата:
Сообщение: RE: Why is this doing a seq scan?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Why is this doing a seq scan?