Re: [HACKERS] Interesting behaviour !

From: Constantin Teodorescu <teo(at)flex(dot)ro>
To: Hannu Krosing <hannu(at)trust(dot)ee>
Cc: "pgsql-hackers(at)postgreSQL(dot)org" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Interesting behaviour !
Date: 1999-07-14 12:17:59
Message-ID: 378C7FF7.D2334A21@flex.ro
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hannu Krosing wrote:
>
> You may try :
>
> explain select * from note where perioada=15::int2;
>
> i think that the default for 'untyped' numbers is int4 and
> this currently confuses the optimiser.

You are right! Thanks a lot! Watch this!

contabil=> explain select * from note where perioada=29::int2;
NOTICE: QUERY PLAN:
Index Scan using note_perioada on note (cost=108.96 rows=1600 width=87)

EXPLAIN
contabil=> explain select * from note where perioada=29;
NOTICE: QUERY PLAN:
Seq Scan on note (cost=1099.99 rows=1600 width=87)

My queries are faster now!

I think that this thing should be fixed. You need more than common SQL
in order to optimize your queries.
That conversions should be automatically assumed by the query optimizer
in order to deliver real performances.
I don't know how difficult that would be.

Thanks a lot,
Best regards,
--
Constantin Teodorescu
FLEX Consulting Braila, ROMANIA

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Ridout 1999-07-14 12:55:21 RE: [HACKERS] Updated TODO list
Previous Message Jeff MacDonald 1999-07-14 12:12:05 Re: [HACKERS] Updated TODO list