Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id A0B299FA3DA for ; Sun, 7 Jan 2007 22:48:00 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 46751-06 for ; Sun, 7 Jan 2007 22:47:50 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id B0E559FA385 for ; Sun, 7 Jan 2007 22:47:55 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l082lqwK019874; Sun, 7 Jan 2007 21:47:52 -0500 (EST) To: "Adam Rich" cc: "'Craig A. James'" , "'Guy Rouillier'" , "'PostgreSQL Performance'" Subject: Re: High update activity, PostgreSQL vs BigDBMS In-reply-to: <022d01c732cc$69f0e2a0$6400a8c0@dualcore> References: <022d01c732cc$69f0e2a0$6400a8c0@dualcore> Comments: In-reply-to "Adam Rich" message dated "Sun, 07 Jan 2007 20:26:29 -0600" Date: Sun, 07 Jan 2007 21:47:52 -0500 Message-ID: <19873.1168224472@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/90 X-Sequence-Number: 22691 "Adam Rich" writes: > I'm using 8.2 and using order by & limit is still faster than MAX() > even though MAX() now seems to rewrite to an almost identical plan > internally. Care to quantify that? AFAICT any difference is within measurement noise, at least for the case of separately-issued SQL commands. > Count(*) still seems to use a full table scan rather than an index scan. Yup. Don't hold your breath for something different. Postgres has made design choices that make certain cases fast and others slow, and count(*) is one case that has come out on the short end of the stick. If that's your most important measure of performance, then indeed you should select a different database that's made different tradeoffs. regards, tom lane