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

From Emre Hasegeli
Subject Re: Selectivity estimation for inet operators
Date
Msg-id CAE2gYzwhAeZCqy2KYLqoT2_nPv-Vo8k=pzp+Z7Sqx4V4jhoyXA@mail.gmail.com
Whole thread Raw
In response to Selectivity estimation for inet operators  (Emre Hasegeli <emre@hasegeli.com>)
List pgsql-hackers
I wanted to check the patch last time and found a bug effecting
MVC vs MVC part of the join selectivity. Fixed version attached.

Emre Hasegeli <emre@hasegeli.com>:
> Comparing the lists with each other slows down the function when
> statistics set to higher values. To avoid this problem I only use
> log(n) values of the lists. It is the first log(n) value for MCV,
> evenly separated values for histograms. In my tests, this optimization
> does not affect the planning time when statistics = 100, but does
> affect accuracy of the estimation. I can send the version without
> this optimization, if slow down with larger statistics is not a problem
> which should be solved on the selectivity estimation function.

Also, I changed this from log(n) to sqrt(n). It seems much better
now.

I try to explain the reason to processes some of the values with more
comments. I hope it is understandable.

Attachment

pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: include_dir catch-22
Next
From: Heikki Linnakangas
Date:
Subject: Re: Minmax indexes