Re: "NOT IN" substantially slower in 9.0.2 than 8.3.13 - NOT EXISTS runs fast in both 8.3.13 and 9.0.2

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: "Robert Haas" <robertmhaas(at)gmail(dot)com>, "Achilleas Mantzios" <achill(at)matrix(dot)gatewaynet(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: "NOT IN" substantially slower in 9.0.2 than 8.3.13 - NOT EXISTS runs fast in both 8.3.13 and 9.0.2
Date: 2011-01-21 20:22:24
Message-ID: 19623.1295641344@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> If it should be less than 1, then what?

> 1 - (estimated tuples / estimated distinct values) ?

Uh, no. The number we're after is the probability that an outer tuple
has at least one unequal value in the inner relation. This is not 1
minus the probability that a *specific* inner value is equal, which is
what I think your formula is estimating.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message grant 2011-01-21 20:23:15 Re: Fun little performance IMPROVEMENT...
Previous Message Greg Smith 2011-01-21 20:19:21 Re: Fun little performance IMPROVEMENT...