Re: Selectivity estimation for inet operators - Mailing list pgsql-hackers

From Emre Hasegeli
Subject Re: Selectivity estimation for inet operators
Date
Msg-id CAE2gYzyqnu07EJdK6MXwimU0hw40KV4Os5=WbTGiVTmM+F4k-Q@mail.gmail.com
Whole thread Raw
In response to Re: Selectivity estimation for inet operators  (Emre Hasegeli <emre@hasegeli.com>)
Responses Re: Selectivity estimation for inet operators
List pgsql-hackers
New version of the patch attached with the optimization to break the
loop before looking at all of the histogram values.  I can reduce
join selectivity estimation runtime by reducing the values of the
left hand side or both of the sides, if there is interest.

> > Even if the above aspects of the code are really completely right, the
> > comments fail to explain why.  I spent a lot of time on the comments,
> > but so far as these points are concerned they still only explain what
> > is being done and not why it's a useful calculation to make.
>
> I couldn't write better comments because I don't have strong arguments
> about it.  We can say that we don't try to make use of the both of
> the endpoints, because we don't know how to combine them.  We only use
> the one with matching family and masklen, and when both of them match
> we use the distant one to be on the safer side.

I added two more sentences to explain the calculation.

Attachment

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: EXPERIMENTAL: mmap-based memory context / allocator
Next
From: Andrew Dunstan
Date:
Subject: Re: mogrify and indent features for jsonb