Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 35C076324A5 for ; Mon, 21 Dec 2009 23:45:45 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 56186-09 for ; Tue, 22 Dec 2009 03:45:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by mail.postgresql.org (Postfix) with ESMTP id 67FF6632FD6 for ; Mon, 21 Dec 2009 23:45:34 -0400 (AST) Received: by qw-out-2122.google.com with SMTP id 9so1115166qwb.61 for ; Mon, 21 Dec 2009 19:45:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=glDbDVKT/fk+BzS+gb75G9kcljPrtuGXLQOcOUrDfKA=; b=pemRurJEwn4eHioBa016uAx1QlrA96uKnCjT7q0eXyDLe7denmAOd9hBCJ6u069cI2 hGyGiFS7rYtrHkCOdOXt0Y/WedDfopcainSRctxB1hXtESUoiTUDBI3TAszxAXF2Z1WJ MYdMjcWfm1l2JU4iHFxGVKQ7/FII+Wp5xVpEo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=R7pGZU/VplOGuQ8gJycB58GlErnBwtJ2WapobiO68ahTgL0ByPaIOZalgzn7lkSYFD NxGx+Nz0PS/zeP+8pO4u/D6sqcBpbsTkubVrjMWR4tSP9iBoh9fC9XmFyZknLrxBA4sh FEeLZzWIcTZnI3r1s2pQYvq0pnKiOIlOV69rw= MIME-Version: 1.0 Received: by 10.229.119.137 with SMTP id z9mr1524095qcq.83.1261453527812; Mon, 21 Dec 2009 19:45:27 -0800 (PST) In-Reply-To: References: <302670f20912211415n4fc73b04x19eebfb9ff0acd60@mail.gmail.com> Date: Mon, 21 Dec 2009 22:45:27 -0500 Message-ID: <302670f20912211945n1b6684e9xb304d4508766f117@mail.gmail.com> Subject: Re: 8.4.1 distinct query WITHOUT order by From: Gary Chambers To: Scott Marlowe Cc: Thomas Kellerer , pgsql-sql@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200912/51 X-Sequence-Number: 33489 > Yeah, if you're code base is that fragile, bandaging it up by jumping > through hoops in pgsql is just putting off the inevitable when it (the > code base) has to get recompiled someday anyway. I appreciate (and agree with) the concern about the fragility of the codebase. The maintainer knows that anything except adding ORDER BY is a kludge. Now, the aforementioned notwithstanding... Aside from disabling enable_hashagg (which, according to the documentation, is performance-expensive), what other options do I have? What are the ramifications of renaming the table (containing 8000 rows) and creating a view of the same name? Assuming it's possible, would the efficiency of a rule to rewrite the query be an acceptable alternative? Thanks in advance for any insight and suggestions! -- Gary Chambers /* Nothing fancy and nothing Microsoft! */