From: Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
To: pgsql-performance@postgresql.org
Subject: Re: Diferent execution plan for similar query
Date: Mon, 28 Apr 2003 16:11:33 +0530
Message-ID: <200304281611.33669.shridhar_daithankar@nospam.persistent.co.in> (raw)
In-Reply-To: <003401c30d70$92c07310$8001010a@sipec.es>
References: <003401c30d70$92c07310$8001010a@sipec.es>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: shridhar_daithankar@persistent.co.in
Subject: Re: Diferent execution plan for similar query
In-Reply-To: <200304281611.33669.shridhar_daithankar@nospam.persistent.co.in>
References: <003401c30d70$92c07310$8001010a@sipec.es> <200304281611.33669.shridhar_daithankar@nospam.persistent.co.in>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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