Re: Export user visible function to make use of convert_to_scalar

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Export user visible function to make use of convert_to_scalar
Date: 2007-07-31 17:10:13
Message-ID: 26551.1185901813@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>> Gregory Stark <stark(at)enterprisedb(dot)com> writes:
>>> Attached is a patch which implements, as discussed briefly on -hackers, a
>.> user-visible function to get at the information that convert_to_scalar uses to
>>> generate selectivity estimates.
>>
>> This is an astonishingly bad idea, as it exposes and thereby sets in
>> stone one of the worst, most in-need-of-rethinking areas in selfuncs.c.

> No, it sets in stone only the concept that at some point somehow we'll have to
> come up with an estimate of where a value lies in a range.

The problem is how much of the actual behavior of that function gets
exposed, and in particular what context it needs to make the estimate.
Further down the road, for example, we might need a locale as an input.

When complaining I hadn't read the pghackers thread in which you
suggested this, and now that I'm caught up on email I remain
unconvinced. What do you need convert_to_scalar for in order to display
the pg_statistic histogram? You've already got the underlying data.

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2007-07-31 17:21:20 Re: [PATCHES] allow CSV quote in NULL
Previous Message Andrew Dunstan 2007-07-31 16:55:35 Re: [PATCHES] allow CSV quote in NULL