fool-toleranced optimizer - Mailing list pgsql-hackers

From Oleg Bartunov
Subject fool-toleranced optimizer
Date
Msg-id Pine.GSO.4.62.0503090157100.3626@ra.sai.msu.su
Whole thread Raw
Responses Re: fool-toleranced optimizer  (Neil Conway <neilc@samurai.com>)
List pgsql-hackers
Hi there,

I just noticed a little optimizer problem - in second query there is
unused 'tycho t2' table alias which gets backend buried. This is 
artificial query, I just tried to check if optimizier could recognize
this.

tycho=# explain analyze select t.pm_ra,t.pm_dec from tycho t where t.pm_ra < 20.2 and t.pm_ra> 18;
                                  QUERY PLAN 
 

-----------------------------------------------------------------------------------------------------------------------------
IndexScan using pm_ra_idx on tycho t  (cost=0.00..9821.83 rows=2613 width=8) (actual time=0.061..12.518 rows=1466
loops=1)  Index Cond: ((pm_ra < 20.2::double precision) AND (pm_ra > 18::double precision)) Total runtime: 14.726 ms
 
(3 rows)

tycho=# explain analyze select t.pm_ra,t.pm_dec from tycho t, tycho t2 where t.pm_ra < 20.2 and t.pm_ra> 18;
...........................................
It's doing Nested Loop, probably, so I didn' wait until it completed....


    Regards,        Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83


pgsql-hackers by date:

Previous
From: "Moran.Michael"
Date:
Subject: Re: How to cast VARCHAR to BYTEA and vice-versa?
Next
From: Neil Conway
Date:
Subject: Re: fool-toleranced optimizer