On Thu, Mar 12, 2020 at 5:38 AM Alvaro Herrera <alvhe...@2ndquadrant.com> wrote: > ... thinking about gist+spgist, I think they could be written > identically to those for ranges, using the lowest (first) lower bound > and the higher (last) upper bound. > > ... thinking about selectivity, I think the way to write that is to > first compute the selectivity for the range across the first lower bound > and the last upper bound, and then subtract that for the "negative" > space between the contained ranges. > > I have no immediate thoughts about typanalyze. I suppose it should be > somehow based on the implementation for ranges ... maybe a first-cut is > to construct fake ranges covering the whole multirange (as above) and > just use the ranges implementation (compute_range_stats).
Thanks, this is pretty much what I was thinking too, but I'm really glad to have someone who knows better confirm it. I can get started on these right away, and I'll let folks know if I need any help. When I looked at this last fall there was a lot I didn't understand. More or less using the existing ranges implementation should be a big help though. Paul