pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adam Rich <adam.r@sbcglobal.net>
To: 'Craig A. James' <cjames@modgraph-usa.com>
To: 'Guy Rouillier' <guyr-ml1@burntmail.com>
To: 'PostgreSQL Performance' <pgsql-performance@postgresql.org>
Subject: Re: High update activity, PostgreSQL vs BigDBMS
Date: Sun, 7 Jan 2007 20:26:29 -0600
Message-ID: <022d01c732cc$69f0e2a0$6400a8c0@dualcore> (raw)
In-Reply-To: <45A188AF.5070006@modgraph-usa.com>


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.

Count(*) still seems to use a full table scan rather than an index scan.

Using one of our tables, MySQL/Oracle/MS-SQL all return instantly while
PG takes longer ther 700ms.  Luckily we can design around this issue.


-----Original Message-----
From: pgsql-performance-owner@postgresql.org
[mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Craig A.
James
Sent: Sunday, January 07, 2007 5:57 PM
To: Guy Rouillier; PostgreSQL Performance
Subject: Re: [PERFORM] High update activity, PostgreSQL vs BigDBMS


Craig A. James wrote:
> The "idiom" to replace count() was 
> "select col from tbl order by col desc limit 1".  It worked miracles
for 
> my app.

Sorry, I meant to write, "the idiom to replace MAX()", not count()...
MAX() was the function that was killing me, 'tho count() also gave me
problems.

Craig

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend




view thread (39+ messages)  latest in thread

Message-ID: <022d01c732cc$69f0e2a0$6400a8c0@dualcore>
Permalink:  ../022d01c732cc$69f0e2a0$6400a8c0@dualcore/
Also on:    postgresql.org/message-id/022d01c732cc$69f0e2a0$6400a8c0@dualcore

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: adam.r@sbcglobal.net, cjames@modgraph-usa.com, guyr-ml1@burntmail.com
  Subject: Re: High update activity, PostgreSQL vs BigDBMS
  In-Reply-To: <022d01c732cc$69f0e2a0$6400a8c0@dualcore>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox