Re: Faster performance when using where cust_id = '123' vs cust_id = 123. Does 7.4 fix this??

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Faster performance when using where cust_id = '123' vs cust_id = 123. Does 7.4 fix this??
Дата
Msg-id 200312092245.46122.peter_e@gmx.net
обсуждение исходный текст
Ответ на Faster performance when using where cust_id = '123' vs cust_id = 123. Does 7.4 fix this??  ("David B" <postgresql@thegatelys.com>)
Список pgsql-sql
David B wrote:
> We have got used to the problem that queries of the format:
>
> select *
> from customer
> where cust_id = '123' are much much faster than
>
> select *
> from customer
> where cust_id = 123
>
> (where cust_id is defined as bigint).
>
> a. Why is this.

Because in the second case, the 123 gets resolved too early to type 
integer, which is not index compatible with type bigint.

> b. Will moving to v7.4 change this so we can avoid the whole '123'
> casting thing.

No, but 7.5 will be able to handle it.



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

Предыдущее
От: "David B"
Дата:
Сообщение: Faster performance when using where cust_id = '123' vs cust_id = 123. Does 7.4 fix this??
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Values like ''