Skip site navigation (1) Skip section navigation (2)

Re: Wrong index choosen?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
Cc: Gaetano Mendola <mendola(at)bigfoot(dot)com>,"pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Wrong index choosen?
Date: 2004-07-23 14:45:27
Message-ID: 20162.1090593927@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-performance
Dennis Bjorklund <db(at)zigo(dot)dhs(dot)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

In response to

Responses

pgsql-performance by date

Next:From: Michael AdlerDate: 2004-07-23 15:34:16
Subject: Re: Performance over a LAN
Previous:From: JeffDate: 2004-07-23 12:07:23
Subject: Re: Performance over a LAN

pgsql-hackers by date

Next:From: Andreas Joseph KroghDate: 2004-07-23 16:38:09
Subject: Re: patch for allowing multiple -t options to pg_dump
Previous:From: Tom LaneDate: 2004-07-23 13:49:05
Subject: Re: make LockRelation use top transaction ID

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group