Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 880759FA2EC for ; Tue, 10 Oct 2006 11:07:10 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 13424-08 for ; Tue, 10 Oct 2006 14:07:06 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 583499F9FB1 for ; Tue, 10 Oct 2006 11:07:06 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id E580456435; Tue, 10 Oct 2006 09:07:04 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Tue, 10 Oct 2006 09:07:03 -0500 Date: Tue, 10 Oct 2006 09:07:03 -0500 From: "Jim C. Nasby" To: "Joshua D. Drake" Cc: "Craig A. James" , Brian Herlihy , Postgresql Performance Subject: Re: Simple join optimized badly? Message-ID: <20061010140702.GB72517@nasby.net> References: <20061010011042.93217.qmail@web52308.mail.yahoo.com> <452B108C.7020703@modgraph-usa.com> <452B11FF.5020904@commandprompt.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <452B11FF.5020904@commandprompt.com> X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:061010:jd@commandprompt.com::9HTeqNQkZL3/R5QQ:00000000000000000 00000000000000000000000065JU X-Hashcash: 1:20:061010:cjames@modgraph-usa.com::/xrruE4PMYVguSe9:00000000000000 0000000000000000000000003DjA X-Hashcash: 1:20:061010:btherl@yahoo.com.au::3fh0CtwDRrL/APZI:000000000000000000 000000000000000000000000DZLN X-Hashcash: 1:20:061010:pgsql-performance@postgresql.org::VjmwufhtnxubMWQV:00000 0000000000000000000000001Bzb X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200610/183 X-Sequence-Number: 21312 On Mon, Oct 09, 2006 at 08:22:39PM -0700, Joshua D. Drake wrote: > > > Imagine I got run over by a train, and someone was reading my code. > > Which would be easier for them to maintain: Code with weird SQL, or code > > with sensible, well-written SQL and explicit hints? > > You forgot the most important option: > > Code with appropriate documentation about your weird SQL. > > If you document your code, your argument is moot. You apparently didn't read the whole email. He said he did document his code. But his point is still valid: obscure code is bad even with documentation. Would you put something from the obfuscated C contest into production with comments describing what it does, or would you just write the code cleanly to begin with? -- Jim Nasby jim@nasby.net EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)