Re: How can I Improve performance in Solaris?

Поиск
Список
Период
Сортировка
От scott.marlowe
Тема Re: How can I Improve performance in Solaris?
Дата
Msg-id Pine.LNX.4.33.0308131256280.7316-100000@css120.ihs.com
обсуждение исходный текст
Ответ на Re: How can I Improve performance in Solaris?  (ingrid martinez <ingridm@qoslabs.com>)
Список pgsql-performance
More than likely you are suffering from an affliction known as type
mismatch.  This is listed as tip 9 here on the performance list (funny, it
was sent at the bottom of your reply :-)

What happens is that when you do:

select * from some_table where id=123;

where id is a bigint the query planner assumes you must want 123
cast to int4, which doesn't match int8 (aka bigint) and uses a sequential
scan to access that row.  I.e. it reads the whole table in.

You can force the planner to do the right thing here in a couple of ways:

select * from some_table where id=123::bigint;

-- OR --

select * from some_table where id='123';

On Wed, 13 Aug 2003, ingrid martinez wrote:

> the primary key is   flidload
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match
>



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Perfomance Tuning
Следующее
От: Christopher Browne
Дата:
Сообщение: Re: Perfomance Tuning