Re: Idea about estimating selectivity for single-column expressions - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Idea about estimating selectivity for single-column expressions
Date
Msg-id 407d949e0908190716i42de4b4eq169a9572529d34f2@mail.gmail.com
Whole thread Raw
In response to Idea about estimating selectivity for single-column expressions  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Idea about estimating selectivity for single-column expressions  (Greg Stark <gsstark@mit.edu>)
Re: Idea about estimating selectivity for single-column expressions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Aug 19, 2009 at 3:53 AM, Tom Lane<tgl@sss.pgh.pa.us> wrote:
> * The expression might throw an error for some inputs, for instance
>        (1 / field) < 0.5
> which would fail on zero.  We could recover by wrapping the whole
> estimation process in a subtransaction, but that seems really expensive.
> I thought about arguing that the failure would happen anyway at runtime,
> but that doesn't hold water --- for example, the user might have just
> deleted all the rows with field = 0, and would have grounds to complain
> if the query failed; but there would still be an entry for zero in the
> histogram.

We could add another flag in pg_proc for functions which cannot throw
an error. Perhaps all index operator class operators be required to
use such functions too?


--
greg
http://mit.edu/~gsstark/resume.pdf


pgsql-hackers by date:

Previous
From: Stef Walter
Date:
Subject: Re: pg_hba.conf: samehost and samenet
Next
From: Greg Stark
Date:
Subject: Re: Idea about estimating selectivity for single-column expressions