fool-toleranced optimizer

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: fool-toleranced optimizer
Date: 2005-03-08 23:05:47
Message-ID: Pine.GSO.4.62.0503090157100.3626@ra.sai.msu.su
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
-----------------------------------------------------------------------------------------------------------------------------
Index Scan 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(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2005-03-09 00:02:16 Re: fool-toleranced optimizer
Previous Message Moran.Michael 2005-03-08 22:16:52 Re: How to cast VARCHAR to BYTEA and vice-versa?