pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Achilleas Mantzios <achill@matrix.gatewaynet.com>
Cc: pgsql-performance@postgresql.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: Fri, 21 Jan 2011 15:22:24 -0500
Message-ID: <19623.1295641344@sss.pgh.pa.us> (raw)
In-Reply-To: <4D39918C02000025000399DE@gw.wicourts.gov>
References: <955263366.48014741295283147090.JavaMail.root@ucimail4.uci.cu>
	<201101191110.05268.achill@matrix.gatewaynet.com>
	<21792.1295458016@sss.pgh.pa.us>
	<201101200905.26400.achill@matrix.gatewaynet.com>
	<AANLkTimeC41oJ34yzPPf3wc_qQ_mKT_=krCcD7OMEYsc@mail.gmail.com>
	<AANLkTimeC41oJ34yzPPf3wc_qQ_mKT_=krCcD7OMEYsc@mail.gmail.com>
	<17201.1295638006@sss.pgh.pa.us>
	<4D39918C02000025000399DE@gw.wicourts.gov>

"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> Tom Lane <tgl@sss.pgh.pa.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



view thread (16+ messages)  latest in thread

Message-ID: <19623.1295641344@sss.pgh.pa.us>
Permalink:  ../19623.1295641344@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19623.1295641344@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, Kevin.Grittner@wicourts.gov, robertmhaas@gmail.com, achill@matrix.gatewaynet.com
  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
  In-Reply-To: <19623.1295641344@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox