pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gábriel Ákos <akos.gabriel@i-logic.hu>
To: pgsql-performance@postgresql.org
Subject: Re: count(*) performance
Date: Mon, 27 Mar 2006 20:05:31 +0200
Message-ID: <4428296B.9040505@i-logic.hu> (raw)
In-Reply-To: <20060327134103.GI80726@pervasive.com>
References: <4427E9E8.9030806@i-logic.hu>
	<20060327134103.GI80726@pervasive.com>

Jim C. Nasby wrote:

> But in this case, I'd bet money that if it's taking 4 minutes something
> else is wrong. Have you been vacuuming that table frequently enough?

That gave me an idea. I thought that autovacuum is doing it right, but I
issued a vacuum full analyze verbose , and it worked all the day.
After that I've tweaked memory settings a bit too (more fsm_pages)

Now:

staging=# SELECT count(*) from infx.infx_product;
   count
---------
  3284997
(1 row)

Time: 1301.049 ms

As I saw the output, the database was compressed to 10% of its size :)
This table has quite big changes every 4 hour, let's see how it works.
Maybe I'll have to issue full vacuums from cron regularly.

> What's SELECT relpages FROM pg_class WHERE relname='tablename' show?

This went to 10% as well, now it's around 156000 pages.

Regards,
Akos


-- 
Üdvözlettel,
Gábriel Ákos
-=E-Mail :akos.gabriel@i-logic.hu|Web:  http://www.i-logic.hu=-
-=Tel/fax:+3612367353            |Mobil:+36209278894            =-




view thread (17+ messages)  latest in thread

Message-ID: <4428296B.9040505@i-logic.hu>
Permalink:  ../4428296B.9040505@i-logic.hu/
Also on:    postgresql.org/message-id/4428296B.9040505@i-logic.hu

 · 

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: akos.gabriel@i-logic.hu
  Subject: Re: count(*) performance
  In-Reply-To: <4428296B.9040505@i-logic.hu>

* 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