From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dennis Bjorklund <db@zigo.dhs.org>
Cc: Gaetano Mendola <mendola@bigfoot.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Wrong index choosen?
Date: Fri, 23 Jul 2004 10:45:27 -0400
Message-ID: <20162.1090593927@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.44.0407231354520.9559-100000@zigo.dhs.org>
References: <Pine.LNX.4.44.0407231354520.9559-100000@zigo.dhs.org>
Dennis Bjorklund <db@zigo.dhs.org> writes:
> In this plan it estimates to get 481 but it got 22477. So the estimation
> was very wrong. You can increase the statistics tarhet on the login_time
> and it will probably be better (after the next analyze).
Given the nature of the data (login times), I'd imagine that the problem
is simply that he hasn't analyzed recently enough. A bump in stats
target may not be needed, but he's going to have to re-analyze that
column often if he wants this sort of query to be estimated accurately,
because the fraction of entries later than a given time T is *always*
going to be changing.
regards, tom lane
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: tgl@sss.pgh.pa.us, db@zigo.dhs.org, mendola@bigfoot.com, pgsql-hackers@postgresql.org
Subject: Re: Wrong index choosen?
In-Reply-To: <20162.1090593927@sss.pgh.pa.us>
* 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