Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id D11939FA4B4 for ; Tue, 10 Oct 2006 11:24:45 -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 14481-10 for ; Tue, 10 Oct 2006 14:24:34 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from lists.commandprompt.com (host-130.commandprompt.net [207.173.203.130]) by postgresql.org (Postfix) with ESMTP id F0D689FA4A7 for ; Tue, 10 Oct 2006 11:24:33 -0300 (ADT) Received: from [192.168.1.95] (or-67-76-146-141.sta.embarqhsd.net [67.76.146.141]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k9AEOU8l029211 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 10 Oct 2006 07:24:31 -0700 Message-ID: <452BAD31.3010507@commandprompt.com> Date: Tue, 10 Oct 2006 07:24:49 -0700 From: "Joshua D. Drake" Organization: Command Prompt, Inc. User-Agent: Thunderbird 1.5.0.7 (X11/20060918) MIME-Version: 1.0 To: "Jim C. Nasby" CC: "Craig A. James" , Brian Herlihy , Postgresql Performance Subject: Re: Simple join optimized badly? References: <20061010011042.93217.qmail@web52308.mail.yahoo.com> <452B108C.7020703@modgraph-usa.com> <452B11FF.5020904@commandprompt.com> <20061010140702.GB72517@nasby.net> In-Reply-To: <20061010140702.GB72517@nasby.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.88.4, clamav-milter version 0.88.4 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Tue, 10 Oct 2006 07:24:31 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200610/189 X-Sequence-Number: 21318 Jim C. Nasby wrote: > 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? You are comparing apples to oranges. We aren't talking about an obfuscated piece of code. We are talking about an SQL statement that solves a particular problem. That can easily be documented, and documented with enough verbosity that it is never a question, except to test and see if the problem exists in current versions. Sincerely, Joshua D. Drake -- === The PostgreSQL Company: Command Prompt, Inc. === Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 Providing the most comprehensive PostgreSQL solutions since 1997 http://www.commandprompt.com/