Re: Selectivity estimation for inet operators

From: Emre Hasegeli <emre(at)hasegeli(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Andreas Karlsson <andreas(at)proxel(dot)se>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, dilip(dot)kumar(at)huawei(dot)com
Subject: Re: Selectivity estimation for inet operators
Date: 2014-06-18 08:34:36
Message-ID: CAE2gYzwhAeZCqy2KYLqoT2_nPv-Vo8k=pzp+Z7Sqx4V4jhoyXA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)hasegeli(dot)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 Content-Type Size
inet-selfuncs-v5.patch application/octet-stream 24.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-06-18 09:18:26 Re: Minmax indexes
Previous Message Craig Ringer 2014-06-18 08:06:29 Re: include_dir catch-22