X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 616DC55F07 for ; Tue, 8 Mar 2005 12:28:42 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 49412-03 for ; Tue, 8 Mar 2005 12:28:38 +0000 (GMT) Received: from lerami.lerctr.org (lerami.lerctr.org [192.147.25.11]) by svr1.postgresql.org (Postfix) with ESMTP id C741252AA3 for ; Tue, 8 Mar 2005 12:28:37 +0000 (GMT) Received: from lerlaptop.lerctr.org ([192.147.25.14]) by lerami.lerctr.org with esmtpsa (TLSv1:RC4-MD5:128) (Exim 4.50) id 1D8dpH-0003IT-SK; Tue, 08 Mar 2005 06:28:40 -0600 From: Larry Rosenman Organization: LERCTR Consulting To: Michael Glaesemann Subject: Re: Query issue/8.0.1/Serendipity Date: Tue, 8 Mar 2005 06:28:38 -0600 User-Agent: KMail/1.7.1 Cc: pgsql-sql@postgresql.org References: <200503080548.17179.ler@lerctr.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200503080628.39117.ler@lerctr.org> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/128 X-Sequence-Number: 20607 On Tuesday 08 March 2005 06:21 am, Michael Glaesemann wrote: > Larry, > > Restating your SQL in a more reader-friendly form: [snip] > This is from an error page (and machine generated to boot :) ) > I can see you're using a lot of left joins. You are beginning your left > joins off of ec, so I believe neither e nor c can be referenced as join > conditions. It might work if you reorder the first part of the FROM > clause as the following: > > FROM serendipity_category c > , serendipity_entrycat ec > , serendipity_entries e > LEFT OUTER JOIN serendipity_entryproperties ep_cache_extended > > (Thugh I can't be sure without seeing table definitions.) a pg_dump -s is at: http://www.lerctr.org/~ler/s9y.sql > > It also appears you have a redundant e.timestamp constraint in the > WHERE clause: if e.timestamp is >= 1110241185 it's definitely going to > be <= 1112335200 this query is machine generated, so I'm sure it's based on timestamps. > > Hope this helps. I find white space helps me read my own SQL much more > easily. understood, as I said, it's machine generated :) > > Michael Glaesemann > grzm myrealbox com -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 214-351-4152 E-Mail: ler@lerctr.org US Mail: 3535 Gaspar Drive, Dallas, TX 75220-3611