Re: Optimizer is not choosing index

Поиск
Список
Период
Сортировка
От Markus Innerebner
Тема Re: Optimizer is not choosing index
Дата
Msg-id 74FBA69B-5697-4FDF-98A2-038BBD628126@inf.unibz.it
обсуждение исходный текст
Ответ на Re: Optimizer is not choosing index  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
Hi Tom,

thanks for your suggestion:


> Markus Innerebner <markus.innerebner@inf.unibz.it> writes:
>> The query plan says, that a sequential scan is performed on the edge table. I consider it strange that he is not
accessingon the (btree) index one the edge table. 
>
> This suggests that you have a datatype mismatch:
>
>> "  Hash Cond: ((e.target)::numeric = n.id)"
>
> Your index is presumably on e.target, not e.target::numeric, so it's not
> applicable.  Try to make the join columns the same datatype.

indeed: the id column in the node table had as type numeric, while in edges the target is integer.

After changing it, the index is used again.

many thanks


cheers Markus

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

Предыдущее
От: Han Zhou
Дата:
Сообщение: Re: Fwd: [HACKERS] client performance v.s. server statistics
Следующее
От: Alessandro Gagliardi
Дата:
Сообщение: Why so slow?