pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Reinoud van Leeuwen <reinoud.v@n.leeuwen.net>
To: pgsql-sql@postgresql.org
Subject: Re: Question on COUNT performance
Date: Wed, 14 Jul 2010 14:30:29 +0200
Message-ID: <20100714123029.GH62243@spoetnik.xs4all.nl> (raw)
In-Reply-To: <AANLkTimyhXoid1bAk2FQZUx9TC3Qgh2Ba__-Fu4B8Bco@mail.gmail.com>
References: <AANLkTimyhXoid1bAk2FQZUx9TC3Qgh2Ba__-Fu4B8Bco@mail.gmail.com>

On Wed, Jul 14, 2010 at 09:58:10PM +1000, Anders ??stergaard Jensen wrote:
> Hello mailing list,
> 
> I have a performance problem with my postgres 8.4.4 database. The query is
> the following:
> 
> SELECT count(*) AS count_all FROM "plan_events" WHERE (f_plan_event_acl(17,
> plan_events.id))
> 
>                                                        QUERY PLAN
> 
> ------------------------------------------------------------------------------------------------------------------------
>  Aggregate  (cost=2859.77..2859.78 rows=1 width=0) (actual
> time=4641.720..4641.720 rows=1 loops=1)
>    ->  Seq Scan on plan_events  (cost=0.00..2851.44 rows=3331 width=0)
> (actual time=32.821..4640.116 rows=2669 loops=1)
>          Filter: f_plan_event_acl(17, id)
>  Total runtime: 4641.753 ms
> (4 rows)
> 
> 
> 
> What can I do to improve the performance? 

Have you tried 'select count (1)..."?

Reinoud


-- 
__________________________________________________
"Nothing is as subjective as reality"
Reinoud van Leeuwen    reinoud.v@n.leeuwen.net
http://reinoud.van.leeuwen.net kvk 27320762
__________________________________________________



view thread (10+ messages)  latest in thread

Message-ID: <20100714123029.GH62243@spoetnik.xs4all.nl>
Permalink:  ../20100714123029.GH62243@spoetnik.xs4all.nl/
Also on:    postgresql.org/message-id/20100714123029.GH62243@spoetnik.xs4all.nl

 · 

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-sql@postgresql.org
  Cc: reinoud.v@n.leeuwen.net
  Subject: Re: Question on COUNT performance
  In-Reply-To: <20100714123029.GH62243@spoetnik.xs4all.nl>

* 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