Re: Estimates not taking null_frac element into account with @@ operator? (8.4 .. git-head)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jesper Krogh <jesper(at)krogh(dot)cc>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Estimates not taking null_frac element into account with @@ operator? (8.4 .. git-head)
Date: 2011-02-17 22:20:48
Message-ID: 8108.1297981248@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jesper Krogh <jesper(at)krogh(dot)cc> writes:
> When something evaluates to "null" isn't included in the result,
> shouldn't the query-planner
> then take the null_frac into account when computing the estimate?

The proposed patch seems wrong to me: if we're estimating on the basis
of most-common-value fractions, the null_frac is already accounted for,
because it's not part of the MCV selectivity fractions. IOW, aren't you
double-counting the null fraction?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jesper Krogh 2011-02-17 22:35:23 Re: Estimates not taking null_frac element into account with @@ operator? (8.4 .. git-head)
Previous Message Kevin Grittner 2011-02-17 22:11:28 Re: SSI bug?