Re: Diferent execution plan for similar query
От | Shridhar Daithankar |
---|---|
Тема | Re: Diferent execution plan for similar query |
Дата | |
Msg-id | 200304281611.33669.shridhar_daithankar@nospam.persistent.co.in обсуждение исходный текст |
Ответ на | Diferent execution plan for similar query (<jgimenez@sipec_quitaesto_.es>) |
Ответы |
Re: Diferent execution plan for similar query
|
Список | pgsql-performance |
On Monday 28 April 2003 15:56, jgimenez@sipec_quitaesto_.es wrote: > Somebody could explain me why this query... > > SELECT * > FROM articulos,eans > WHERE articulos.id_iinterno=eans.id_iinterno > AND eans.id_iean=345 > > is slower than this one? (the difference is the quotes around the > number....) > > SELECT * > FROM articulos,eans > WHERE articulos.id_iinterno=eans.id_iinterno > AND eans.id_iean='345' In second case, postgresql typecasted it correctly. Even eans.id_iean=345::int8 would have worked the same way. By default postgresql treats a number as int4 while comparing and integer and float8 for a real numbe. I discovered that yesterday. Until the planner/parser gets smarter, this is going to be an FAQ.. Shridhar
В списке pgsql-performance по дате отправления: