Re: Query performance problem

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Query performance problem
Дата
Msg-id 27336.1093020601@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Query performance problem  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-performance
Bruno Wolff III <bruno@wolff.to> writes:
> I am going to assume that one of the sc.cpfcnpj's above is really rc.cpfcnpj
> since that corresponds to the explain below.

No, actually the explain plan corresponds to the sc.cpfcnpj = sc.cpfcnpj
condition.  I didn't twig to the typo until I started to wonder why the
plan had the condition in the wrong place (attached to the seqscan and
not the join step).

> sc.cpfcnpj and rc.cpfcnpj are different length varchars. You made need
> an explicit cast to allow the use of indexes.

AFAIK the cross-type issues only apply to crossing actual types, not
lengths.  That does look like an error in the database schema, though.

            regards, tom lane

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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: Query performance problem
Следующее
От: Gaetano Mendola
Дата:
Сообщение: Re: using an index worst performances