pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Faster performance when using where cust_id = '123' vs cust_id = 123. Does 7.4 fix this??
2+ messages / 2 participants
[nested] [flat]

* Faster performance when using where cust_id = '123' vs cust_id = 123. Does 7.4 fix this??
@ 2003-12-09 21:35  David B <postgresql@thegatelys.com>
  0 siblings, 1 reply; 2+ messages in thread

From: David B @ 2003-12-09 21:35 UTC (permalink / raw)
  To: pgsql-sql

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.

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

Tx folks,
D




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Faster performance when using where cust_id = '123' vs cust_id = 123. Does 7.4 fix this??
@ 2003-12-09 21:45  Peter Eisentraut <peter_e@gmx.net>
  parent: David B <postgresql@thegatelys.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2003-12-09 21:45 UTC (permalink / raw)
  To: 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.




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-12-09 21:45 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-12-09 21:35 Faster performance when using where cust_id = '123' vs cust_id = 123. Does 7.4 fix this?? David B <postgresql@thegatelys.com>
2003-12-09 21:45 ` Peter Eisentraut <peter_e@gmx.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox