X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8DDC1DAEB6 for ; Wed, 26 Oct 2005 13:13:01 -0300 (ADT) 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 74822-09 for ; Wed, 26 Oct 2005 16:12:58 +0000 (GMT) Received: from web54305.mail.yahoo.com (web54305.mail.yahoo.com [206.190.49.115]) by svr1.postgresql.org (Postfix) with SMTP id A6C6EDAF00 for ; Wed, 26 Oct 2005 13:12:58 -0300 (ADT) Received: (qmail 3432 invoked by uid 60001); 26 Oct 2005 16:12:57 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=rDzZm7Ula4KcYTSDbY5F3iM39pQLscJKWyaAIThcg1j8mTsh0XGAZYErAR/J0vfk//4aWLDXVVI83vZIcn8c6mSEW3Jlq94BCJbVow0X/dReldplsNQR0HeJ5vgVF8otGW5O71rZL7Yw8x6qrCtguEXuZKpe7/6xe862UuEUyUk= ; Message-ID: <20051026161257.3430.qmail@web54305.mail.yahoo.com> Received: from [69.241.169.206] by web54305.mail.yahoo.com via HTTP; Wed, 26 Oct 2005 09:12:57 PDT Date: Wed, 26 Oct 2005 09:12:57 -0700 (PDT) From: chester c young Subject: Re: broken join optimization? (8.0) To: pgsql-sql@postgresql.org In-Reply-To: <1416.1130298824@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.28 required=5 tests=[AWL=-0.093, DNS_FROM_RFC_ABUSE=0.374] X-Spam-Level: X-Archive-Number: 200510/335 X-Sequence-Number: 23188 > Tom Lane wrote: >> Michael Fuhr writes: > > On Tue, Oct 25, 2005 at 04:56:11PM -0700, chester c young wrote: > >> in php (for example) it's frequently nice to get the structure of > >> table without any data, > > > Have you considered "SELECT * FROM mytable LIMIT 0"? > > Indeed. i think i misled: the goal is to retrieve _one_ row where the value of each attribute is null. this can be done laborously using meta data, but is done quite niftily using a left join against one row. > > I see the same behavior in the latest 8.1beta code. Maybe one of > > the developers will comment on whether optimizing that is a simple > > change, a difficult change, not worth changing because few people > > find a use for it, or a behavior that can't be changed because of > > something we're not considering. > > Not worth changing --- why should we expend cycles (even if it only > takes a few, which isn't clear to me offhand) on every join query, to > detect what's simply a brain-dead way of finding out table structure? again, the goal is a quick way to retrieve one row from a table where each attribute value is null, NOT to get the table structure. > I can't think of any realistic scenarios for a constant-false join > clause. i would like a better idea on how to retrieve one row from a table where the value of each attribute is null - i felt this a perfectly good use of sql. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com