| From: | Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us> |
|---|---|
| To: | Constantin Teodorescu <teo(at)flex(dot)ro> |
| Cc: | Hannu Krosing <hannu(at)trust(dot)ee>, "pgsql-hackers(at)postgreSQL(dot)org" <pgsql-hackers(at)postgreSQL(dot)org> |
| Subject: | Re: [HACKERS] Interesting behaviour ! |
| Date: | 1999-07-14 15:14:47 |
| Message-ID: | 199907141514.LAA23027@candle.pha.pa.us |
| Views: | Whole Thread | Raw Message | 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.
I thought we had this fixed in 6.5. Is that what you are using?
--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 1999-07-14 15:16:03 | Re: [HACKERS] Re: 6.5.1 release |
| Previous Message | Bruce Momjian | 1999-07-14 15:14:00 | Re: [HACKERS] Updated TODO list |