Re: Diferent execution plan for similar query - Mailing list pgsql-performance

From Shridhar Daithankar
Subject Re: Diferent execution plan for similar query
Date
Msg-id 200304281611.33669.shridhar_daithankar@nospam.persistent.co.in
Whole thread Raw
In response to Diferent execution plan for similar query  (<jgimenez@sipec_quitaesto_.es>)
Responses Re: Diferent execution plan for similar query
List 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 by date:

Previous
From:
Date:
Subject: Diferent execution plan for similar query
Next
From: "Magnus Naeslund(w)"
Date:
Subject: Re: Diferent execution plan for similar query