Re: strange nested loop row count estimates

From: Sergey Koposov <skoposov(at)cmu(dot)edu>
To: "tgl(at)sss(dot)pgh(dot)pa(dot)us" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: strange nested loop row count estimates
Date: 2019-05-02 04:49:25
Message-ID: 1556772565.7942.240.camel@cmu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 2019-05-02 at 00:36 -0400, Tom Lane wrote:
> Sergey Koposov <skoposov(at)cmu(dot)edu> writes:
> >
> > I'm currently trying to understand the expected row counts for a query involving a nested loop join and bitmap index scan 
> > on the functional index and a custom operator. And the numbers that I see don't make sense to me currently.
> What sort of selectivity estimator have you got attached to that custom
> operator?

This is the code, but basically it is just a constant based on the search radius (which is the leftmost float argument of the operator)
https://github.com/segasai/q3c/blob/361140d4f1f36bf16c9c53721d1c4f03cb4de930/q3c.c#L89
For the query in question it should be ~ 1e-12

The whole idea of the operator was to specifically inform PG that this query returns a small number of rows. 

(the underlying idea of the query is that it does positional crossmatch between datasets on the sphere with a certain small radius). And 
obviously the selectivity of this is is extremely tiny). 

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2019-05-02 05:05:05 Re: strange nested loop row count estimates
Previous Message Tom Lane 2019-05-02 04:36:59 Re: strange nested loop row count estimates