pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PFC <lists@peufeu.com>
To: mark <markkicks@gmail.com>
To: Justin <justin@emproshunts.com>
Cc: pgsql-general@postgresql.org
Cc: pgsql-performance@postgresql.org
Subject: Re: [PERFORM] select query takes 13 seconds to run with index
Date: Tue, 27 May 2008 10:19:37 +0200
Message-ID: <op.ubsz2zqmcigqcu@apollo13.peufeu.com> (raw)
In-Reply-To: <82fa9e310805261632y46f306fdh84e2da62ffbd7873@mail.gmail.com>
References: <82fa9e310805261549m2362fbe8sbf18789938fee833@mail.gmail.com>
	<483B4729.7050402@emproshunts.com>
	<82fa9e310805261632y46f306fdh84e2da62ffbd7873@mail.gmail.com>


>> The estimate is way off, when was the last time Vaccum was on the table?
> about a week ago i ran this VACUUM VERBOSE ANALYZE;
> this table is never updated or deleted, rows are just inserted...

	You should analyze it more often, then... Postgres probably thinks the  
table has the same data distribution as last week !
	Analyze just takes a couple seconds...

>> Load on the database
> how do i measure load on database?

	Just look at vmstat.

	Also if you very often do SELECT .. WHERE x = ... ORDER BY id DESC you'll  
benefit from an index on (x,id) instead of just (x).





view thread (16+ messages)  latest in thread

Message-ID: <op.ubsz2zqmcigqcu@apollo13.peufeu.com>
Permalink:  ../op.ubsz2zqmcigqcu@apollo13.peufeu.com/
Also on:    postgresql.org/message-id/op.ubsz2zqmcigqcu@apollo13.peufeu.com

 · 

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: lists@peufeu.com, markkicks@gmail.com, justin@emproshunts.com, pgsql-general@postgresql.org
  Subject: Re: [PERFORM] select query takes 13 seconds to run with index
  In-Reply-To: <op.ubsz2zqmcigqcu@apollo13.peufeu.com>

* 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