From: Sergey Koposov <skoposov@cmu.edu>
To: tgl@sss.pgh.pa.us <tgl@sss.pgh.pa.us>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: strange nested loop row count estimates
Date: Thu, 2 May 2019 04:49:25 +0000
Message-ID: <1556772565.7942.240.camel@cmu.edu> (raw)
In-Reply-To: <1474.1556771819@sss.pgh.pa.us>
References: <e5cc7ba42336483fa7d072d92718573fc250bcb1.camel@cmu.edu>
<1474.1556771819@sss.pgh.pa.us>
On Thu, 2019-05-02 at 00:36 -0400, Tom Lane wrote:
> Sergey Koposov <skoposov@cmu.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).
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-general@postgresql.org
Cc: skoposov@cmu.edu, tgl@sss.pgh.pa.us
Subject: Re: strange nested loop row count estimates
In-Reply-To: <1556772565.7942.240.camel@cmu.edu>
References: <e5cc7ba42336483fa7d072d92718573fc250bcb1.camel@cmu.edu> <1474.1556771819@sss.pgh.pa.us> <1556772565.7942.240.camel@cmu.edu>
* 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