pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Broken selectivity with special inet operators
Date: Wed, 21 Sep 2011 16:56:17 -0400
Message-ID: <29153.1316638577@sss.pgh.pa.us> (raw)
In-Reply-To: <4E7A4923.1020900@agliodbs.com>
References: <4E7A4923.1020900@agliodbs.com>

Josh Berkus <josh@agliodbs.com> writes:
> Summary: special inet operators ( << >> <<= =>> ) are
> 	up to 1000000X off in estimating rowcounts

A look in pg_operator will show you that these operators have no
associated selectivity estimators at all.  It's not so much "broken"
as "unimplemented".

regression=# select oid::regoperator,oprcode,oprrest,oprjoin from pg_operator where (oprleft = 869 or oprright = 869) and oprresult = 16;
      oid       |    oprcode    |   oprrest   |     oprjoin     
----------------+---------------+-------------+-----------------
 =(inet,inet)   | network_eq    | eqsel       | eqjoinsel
 <>(inet,inet)  | network_ne    | neqsel      | neqjoinsel
 <(inet,inet)   | network_lt    | scalarltsel | scalarltjoinsel
 <=(inet,inet)  | network_le    | scalarltsel | scalarltjoinsel
 >(inet,inet)   | network_gt    | scalargtsel | scalargtjoinsel
 >=(inet,inet)  | network_ge    | scalargtsel | scalargtjoinsel
 <<(inet,inet)  | network_sub   | -           | -
 <<=(inet,inet) | network_subeq | -           | -
 >>(inet,inet)  | network_sup   | -           | -
 >>=(inet,inet) | network_supeq | -           | -
(10 rows)


			regards, tom lane



view thread (7+ messages)  latest in thread

Message-ID: <29153.1316638577@sss.pgh.pa.us>
Permalink:  ../29153.1316638577@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29153.1316638577@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, josh@agliodbs.com
  Subject: Re: Broken selectivity with special inet operators
  In-Reply-To: <29153.1316638577@sss.pgh.pa.us>
  References: <4E7A4923.1020900@agliodbs.com> <29153.1316638577@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