Skip site navigation (1) Skip section navigation (2)

Re: Need help - optimizer trouble

From: "ADBAAMD" <adba(dot)amdocs(at)bell(dot)ca>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Helge Bahmann" <bahmann(at)math(dot)tu-freiberg(dot)de>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Need help - optimizer trouble
Date: 2001-04-05 14:26:38
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Tom Lane wrote:

> 7.1 treats the JOIN clauses as determining join order, where 7.0 did
> not.  Looks like you should re-order the query to be, say,
> SELECT doc FROM written_by AS wb
> 	JOIN author_keyword AS kw ON kw.author_id=wb.author_id
> 	JOIN document ON document.doc_id=wb.doc_id
> 	WHERE kw.keyword='foo'
> This behavior is a bit of a hack, which we'll likely reconsider in
> future releases, but it does have some redeeming social value too.
> See

	Excuse my audacity in posing such a preposterous question... but 
shouldn't the SQL syntax be as free of effects on the physical level as 
possible?  I've already posted a similar question at pgsql-general that 
got no answer, but I will try it again here.

	As I understand from the relational model there should be three levels: 
user, logical and physical.  The SELECT command should pertain to the 
user level, and the access paths to the physical.  Any alteration in the 
behaviour of the optimizer should be or (1) set by the administrator at 
the optimizer itself, or (2) at the logical-physical levels' mapping, or 
(3) thru hints delivered parallel with, but separate to, the SQL syntax 
of the query itself.

	So this change, besides really being a hack, would kind of pollute the 
environment by adding complexity to the use of SQL.  Perhaps it would be 
cleaner to have somehing like Oracle's hints?

	Thanks for your attention.

/ \   Leandro Guimarães Faria Corsetti Dutra         +55 (11) 3040 8913
\ /   Amdocs at Bell Canada                          +1 (514) 786 87 47
  X    Support Center, São Paulo, Brazil          mailto:adbaamd(at)bell(dot)ca
/ \    mailto:leandrod(at)amdocs(dot)com

In response to


pgsql-novice by date

Next:From: Tom LaneDate: 2001-04-05 14:38:34
Subject: Re: Max Tuple Size
Previous:From: AarmelDate: 2001-04-05 14:21:24
Subject: Max Tuple Size

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group