pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Andreas Seltenreich <seltenreich@gmx.de>
Cc: pgsql-hackers@lists.postgresql.org, Tomas Vondra <tomas.vondra@postgresql.org>
Subject: Re: [sqlsmith] Crash in mcv_get_match_bitmap
Date: Wed, 10 Jul 2019 18:48:16 -0400
Message-ID: <19586.1562798896@sss.pgh.pa.us> (raw)
In-Reply-To: <20190710215904.ncaqlswrylliisv3@development>
References: <8736jdhbhc.fsf@ansel.ydns.eu>
	<15097.1562792274@sss.pgh.pa.us>
	<20190710212609.5mrl7hltbozoxpq7@development>
	<17042.1562795124@sss.pgh.pa.us>
	<20190710215904.ncaqlswrylliisv3@development>

Oh ... while we're piling on here, it just sunk into me that
mcv_get_match_bitmap is deciding what the semantics of an operator
are by seeing what it's using for a selectivity estimator.
That is just absolutely, completely wrong.  For starters, it
means that the whole mechanism fails for any operator that wants
to use a specialized estimator --- hardly an unreasonable thing
to do.  For another, it's going to be pretty unreliable for
extensions, because I do not think they're all careful about using
the right estimator --- a lot of 'em probably still haven't adapted
to the introduction of separate <= / >= estimators, for instance.

The right way to determine operator semantics is to look to see
whether they are in a btree opclass.  That's what the rest of the
planner does, and there is no good reason for the mcv code to
do it some other way.

			regards, tom lane





view thread (19+ messages)  latest in thread

Message-ID: <19586.1562798896@sss.pgh.pa.us>
Permalink:  ../19586.1562798896@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19586.1562798896@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-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, tomas.vondra@2ndquadrant.com, seltenreich@gmx.de, tomas.vondra@postgresql.org
  Subject: Re: [sqlsmith] Crash in mcv_get_match_bitmap
  In-Reply-To: <19586.1562798896@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