Re: Hypothetical indexes using BRIN broken since pg10

From: Alvaro Herrera from 2ndQuadrant <alvherre(at)alvh(dot)no-ip(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Julien Rouhaud <rjuju123(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Hypothetical indexes using BRIN broken since pg10
Date: 2019-09-09 14:53:35
Message-ID: 20190909145335.GA26974@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-Sep-02, Tom Lane wrote:

> Julien Rouhaud <rjuju123(at)gmail(dot)com> writes:
> > On Fri, Jul 26, 2019 at 1:34 PM Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:
> >> The patch assumes the default pages_per_range setting, but looking at
> >> the code at https://github.com/HypoPG/hypopg, the extension actually
> >> takes pages_per_range into account when it estimates the index size. I
> >> guess there's no easy way to pass the pages_per_range setting down to
> >> brincostestimate(). I'm not sure what we should do about that, but seems
> >> that just using BRIN_DEFAULT_PAGES_PER_RANGE here is not very accurate.
>
> > Yes, hypopg can use a custom pages_per_range as it intercepts it when
> > the hypothetical index is created. I didn't find any way to get that
> > information in brincostestimate(), especially for something that could
> > backpatched. I don't like it, but I don't see how to do better than
> > just using BRIN_DEFAULT_PAGES_PER_RANGE :(
>
> I can tell you what I think ought to happen, but making it happen might
> be more work than this patch should take on.
>
> The right answer IMO is basically for the brinGetStats call to go
> away from brincostestimate and instead happen during plancat.c's
> building of the IndexOptInfo. In the case of a hypothetical index,
> it'd fall to the get_relation_info_hook to fill in suitable fake
> data.

So I'm not clear on what the suggested strategy is, here. Do we want
that design change to occur in the bugfix that would be backpatched, or
do we want the backbranches to use the patch as posted and then we apply
the above design on master only?

If the former -- is Julien interested in trying to develop that?

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Cramer 2019-09-09 14:58:02 pg_upgrade issues
Previous Message Andrew Gierth 2019-09-09 14:29:36 Re: Set of header files for Ryu floating-point stuff in src/common/