Re: Strange (?) Index behavior?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Matt Clark <matt(at)ymogen(dot)net>
Cc: Allen Landsidel <alandsidel(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Strange (?) Index behavior?
Date: 2004-11-06 04:04:23
Message-ID: 25492.1099713863@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Matt Clark <matt(at)ymogen(dot)net> writes:
> Well, 74000/76000000 ~= 0.1%, way less than 1/26, so no surprise that an
> indexscan is better, and also no surprise that the planner can't know
> that I is such an uncommon initial char.

But it *can* know that, at least given adequate ANALYZE statistics.
I'm pretty convinced that the basic answer to Allen's problem is to
increase the histogram size. How large he needs to make it is not
clear --- obviously his data distribution is not uniform, but I don't
have a fix on how badly non-uniform.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2004-11-06 04:06:51 Re: vacuum analyze slows sql query
Previous Message Vishal Kashyap @ [Sai Hertz And Control Systems] 2004-11-06 03:01:44 Re: postgresql amd-64