Re: Estimating costs (was Functional Indices)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, kavoos <kavoos(at)issn(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: Estimating costs (was Functional Indices)
Date: 2001-05-23 14:48:35
Message-ID: 14644.990629315@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> But I know something that postgres doesn't. The data is clustered somewhat
> around the id we're comparing on. There is a "runlength" involved. Thus,
> when doing an index scan, once it has read in the first tuple of a run there
> will be more just sitting in the cache at basically zero cost.

Hm. There is code in development sources that will notice data
clustering --- actually what it looks at is the correlation between
physical tuple order and logical order of the values. I'm not sure
whether it would do the right thing if you have runs of identical keys
but no overall ordering of the keys, however.

> Currently I work around this by fiddling enable_seqscan is strategic places
> but that's blunt instrument.

Yup, it sure is. Can you propose a statistical measurement that would
cope with this situation?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Feite Brekeveld 2001-05-23 14:54:56 Re: IpcMemoryCreate
Previous Message Renaud Thonnart 2001-05-23 14:45:55 Re: OID again