Re: Optimisation deficiency: currval('seq')-->seq scan, constant-->index scan

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tiago Antão <tra(at)fct(dot)unl(dot)pt>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jules Bean <jules(at)jellybean(dot)co(dot)uk>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Optimisation deficiency: currval('seq')-->seq scan, constant-->index scan
Date: 2000-10-14 04:25:17
Message-ID: 200010140425.AAA23064@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Hi!
>
> On Wed, 23 Aug 2000, Tom Lane wrote:
>
> > Yes, we know about that one. We have stats about the most common value
> > in a column, but no information about how the less-common values are
> > distributed. We definitely need stats about several top values not just
> > one, because this phenomenon of a badly skewed distribution is pretty
> > common.
>
>
> An end-biased histogram has stats on top values and also on the least
> frequent values. So if a there is a selection on a value that is well
> bellow average, the selectivity estimation will be more acurate. On some
> research papers I've read, it's refered that this is a better approach
> than equi-width histograms (which are said to be the "industry" standard).

I like this. I never liked the equal-size histograms. The lookup time
was too slow, and used too much disk space.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message The Hermit Hacker 2000-10-14 04:37:28 Re: Optimisation deficiency: currval('seq')-->seq scan, constant-->index scan
Previous Message Tom Lane 2000-10-14 04:22:10 Re: AW: Inserting a select statement result into another ta ble