X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 801E9D1B4ED for ; Tue, 7 Oct 2003 16:20:04 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 40110-03 for ; Tue, 7 Oct 2003 13:19:17 -0300 (ADT) Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by svr1.postgresql.org (Postfix) with ESMTP id D408FD1B4E5 for ; Tue, 7 Oct 2003 13:19:15 -0300 (ADT) Received: from klaster.net (core-1.citynet.pl [80.48.135.69]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 252AA2B3D8; Tue, 7 Oct 2003 18:18:03 +0200 (CEST) Message-ID: <3F82E734.8060003@klaster.net> Date: Tue, 07 Oct 2003 18:17:56 +0200 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; pl-PL; rv:1.5) Gecko/20030916 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: pginfo Cc: "pgsql-sql@postgresql.org" Subject: Re: Interest query plan References: <3F82D4FE.DD4E275B@t1.unisoftbg.com> In-Reply-To: <3F82D4FE.DD4E275B@t1.unisoftbg.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/80 X-Sequence-Number: 15480 > Hi all, > I am running pg 7.3.1. > My query is very simple but pg generates not the best possible plan for > me: > analyze select * from a_doc D left outer join (A_SKLAD S join A_MED M > ON(S.IDS_MED=M.IDS) )on( d.IDS=s.IDS_DOC) where d.IDS='SOF_700060'; What about: select * from a_doc D left join A_SKLAD S on(d.IDS=s.IDS_DOC) left join A_MED M ON(S.IDS_MED=M.IDS) where d.IDS='SOF_700060' ? Regards, Tomasz Myrta