auto-casting a bit more intelligent in 8.0 ... ?

Поиск
Список
Период
Сортировка
От Marc G. Fournier
Тема auto-casting a bit more intelligent in 8.0 ... ?
Дата
Msg-id 20040823233453.J4215@ganymede.hub.org
обсуждение исходный текст
Ответы Re: auto-casting a bit more intelligent in 8.0 ... ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Just had a "performance" question from a client ... the query they were 
running, through EXPLAIN ANALYZE, was showing 37ms to resolve ... there 
are indices on the two fields being queried, but only used on one of them 
...

by changing the query *very slightly* (adding ::bigint to force-cast one 
of the where clauses), I brought it down to .1ms ...

the field in the table is defined as bigint, \d on the index shows its an 
index on bigint, but the query does it as:

field = 0

so, its trying bigint = int, and not picking up the index ...

the database server is 7.4.3 ... is this something that has been made a 
bit more intelligent in 8.0?  other then casting 0 to bigint, is there 
something else I should be looking at doing?  Having them go through all 
of their code and casting all ints to bigint for this sounds a bit extreme 
:(

Thanks ...

----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664


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

Предыдущее
От: Philip Warner
Дата:
Сообщение: Re: New warning in pg_dump
Следующее
От: Tom Lane
Дата:
Сообщение: Re: 8.0 beta 1 on linux-mipsel R5900