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

Re: Strange Index behavior

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Együd Csaba (Freemail) <csegyud(at)freemail(dot)hu>
Cc: 'Együd Csaba' <csegyud(at)vnet(dot)hu>,pgsql-general(at)postgresql(dot)org
Subject: Re: Strange Index behavior
Date: 2004-12-22 18:00:46
Message-ID: 5666.1103738446@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-general
=?iso-8859-2?Q?Egy=FCd_Csaba_=28Freemail=29?= <csegyud(at)freemail(dot)hu> writes:
> The difference between the result times is 16x. I can't understand why the
> planner thinks it is the better way...

The planner thinks that because it thinks the second query will fetch
1500 times as many rows as the first.  Now that I look more carefully
I see that both of those row estimates are off, the first by a lot.
Have you ANALYZEd this table lately?  If you have, it might be a good
idea to increase the statistics target for the tstamp column.

You might also need to play around with random_page_cost, but it will be
counterproductive to touch that until the rowcount estimates are in the
vicinity of reality.

			regards, tom lane

In response to

Responses

pgsql-general by date

Next:From: Scott MarloweDate: 2004-12-22 18:08:10
Subject: Re: postgresql.conf
Previous:From: A. MousDate: 2004-12-22 17:58:07
Subject: Re: 8.0 Beta3 worked, RC1 didn't!

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