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

From Tom Lane
Subject Re: Selectivity estimation for inet operators
Date
Msg-id 16889.1427923145@sss.pgh.pa.us
Whole thread Raw
In response to Re: Selectivity estimation for inet operators  (Emre Hasegeli <emre@hasegeli.com>)
List pgsql-hackers
Emre Hasegeli <emre@hasegeli.com> writes:
> [ inet-selfuncs-v14.patch ]

After further reflection I concluded that the best way to deal with the
O(N^2) runtime problem for the join selectivity function was to set a
limit on the number of statistics values we'd consider, as was discussed
awhile back IIRC.  We can easily consider just the first N values of the
MCV arrays, since those are sorted by decreasing frequency anyway.  For
the histogram arrays, taking every K'th value seems like the thing to do.

I made the limit be 1024 elements as that seemed to give an acceptable
maximum runtime (a couple hundred msec on my machine).  We could probably
reduce that if anyone feels the max runtime needs to be less.

I had to drop the idea of breaking out of the histogram loop early as that
didn't play nicely with the decimation logic, unfortunately.

Anyway, pushed.  Thanks for your perseverance on this!
        regards, tom lane



pgsql-hackers by date:

Previous
From: Christoph Berg
Date:
Subject: Re: Re: [pgsql-pkg-debian] Updated libpq5 packages cause connection errors on postgresql 9.2
Next
From: Bruce Momjian
Date:
Subject: Re: pg_upgrade needs postmaster [sic]