From: Michael Glaesemann <grzm@seespotcode.net>
To: Mikko Partio <mpartio@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Slow indexscan
Date: Wed, 20 Jun 2007 11:53:44 -0500
Message-ID: <A52DA702-F83C-4DC0-BBD6-49D7FC075A2B@seespotcode.net> (raw)
In-Reply-To: <2ca799770706200702y1074f066s61279b67f93315d0@mail.gmail.com>
References: <2ca799770706200702y1074f066s61279b67f93315d0@mail.gmail.com>
On Jun 20, 2007, at 9:02 , Mikko Partio wrote:
> Relevant facts:
> pg version 7.3.4 (yeah very old, we are upgrading asap)
There have been many performance improvements—not to mention security
and data-eating bug fixes—since then. Upgrading should be one of your
highest priorities. And it may even fix the issue at hand!
> Index Scan using tbl_20070601_pkey on tbl_20070601 t1
> (cost=0.00..365.13rows=13 width=137) (actual time=
> 120.83..10752.64 rows=539 loops=1)
Something appears a bit off with your index, or at least the
statistics Postgres is using to estimate it. It's estimating that the
query will return 13 rows, but you're actually returning 539. Maybe
there's some corruption in the index which is leading to both the
performance issue you're seeing and the statistics issues. Have you
tried REINDEX?
Michael Glaesemann
grzm seespotcode net
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: grzm@seespotcode.net, mpartio@gmail.com
Subject: Re: Slow indexscan
In-Reply-To: <A52DA702-F83C-4DC0-BBD6-49D7FC075A2B@seespotcode.net>
* 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