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 17:22:41
Message-ID: 15848.990638561@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:
> I was thinking "average runlength". If this were 10 for example, when it
> came to calculating the cost of the index scan, it would divide the
> per-tuple cost by 10.

> You can go the simple calculation method which would count the number of
> times the value in a column was different than the previous value, then
> divide that into the total number of tuples. That's not difficult to
> implement.

Unfortunately, it is difficult to implement, in fact impossible, given
the new sampling-based implementation of ANALYZE. You could only
discover that runs of identical keys exist if you were willing to
examine every row, not just a statistical sample.

Since this seems a rather specialized situation, I'm not eager to pay
that high a price to recognize it ...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Jones 2001-05-23 17:39:15 Re: Re: ZeroFill(.../pg_xlog/xlogtemp.20148) failed: No such file or directory
Previous Message Feite Brekeveld 2001-05-23 17:21:07 Re: IpcMemoryCreate