X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 92610D1C976 for ; Tue, 18 Nov 2003 15:07:20 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 45285-07 for ; Tue, 18 Nov 2003 11:06:53 -0400 (AST) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by svr1.postgresql.org (Postfix) with ESMTP id ED59DD1D80C for ; Tue, 18 Nov 2003 11:06:48 -0400 (AST) Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AM7R6-0001K5-00 for ; Tue, 18 Nov 2003 16:06:36 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AM7R5-0001Jx-00 for ; Tue, 18 Nov 2003 16:06:35 +0100 Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AM7R5-0007T4-00 for ; Tue, 18 Nov 2003 16:06:35 +0100 From: Troels Arvin Subject: Re: Quota query with decent performance? Date: Tue, 18 Nov 2003 16:06:36 +0100 Lines: 21 Message-ID: References: <20031118125642.GC30809@wolff.to> <20031118143627.GA32105@wolff.to> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@sea.gmane.org User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/216 X-Sequence-Number: 16031 On Tue, 18 Nov 2003 08:36:27 -0600, Bruno Wolff III wrote: > The standard syntax is expression is false instead of > isfalse(expression) OK, so I guess that a 'better' (closer to standard) version of your query would be: SELECT * FROM pview WHERE ( age <= ( SELECT age FROM pview ORDER BY age ASC LIMIT 1 OFFSET 20 -- 2=n-1 ) ) IS NOT FALSE; -- Greetings from Troels Arvin, Copenhagen, Denmark