Re: allowing extensions to control planner behavior

From: Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>
To: Andrei Lepikhov <lepihov(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: allowing extensions to control planner behavior
Date: 2024-10-18 07:56:51
Message-ID: CAKZiRmyZiJbgduUaKJR+vfLDzm-ack+66hVA5Gkj19aLqcgW-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Andrei,

On Fri, Oct 11, 2024 at 8:21 AM Andrei Lepikhov <lepihov(at)gmail(dot)com> wrote:

> On 10/10/24 23:51, Robert Haas wrote:
> > On Wed, Sep 18, 2024 at 11:48 AM Robert Haas <robertmhaas(at)gmail(dot)com>
> wrote:
> > 1. If you want to specify in-query hints using comments, how does your
> > extension get access to the comments?
> Having designed two features [1,2] that do the stuff mostly similar to
> pg_hint_plan but based on real cardinalities earned from previous
> executions, I can say the most annoying problem is hinting subqueries &
> CTEs. Sometimes, you want to hint at the top query and not touch the
> subquery and vice versa. Sometimes, users get stuck in accidents when a
> flattened subquery influences your hint. So, the key property to invent
> in advance should be an identification system.
> I have chosen hash-based identification when each RelOptInfo has a hash
> created over values of relids, restrictions and hashes of underlying
> RelOptInfos. At the core, it seems inappropriate.
>

out of curiosity, why do You think it would be inappropriate to do so in
the core? Maybe it Is something similiar to compute_query_id that can be
computed externally too. I remember Tom arguing that query_id should be
computed externally by extension for some reasons because each extension
may want differently to fingerprint the queries, but I cannot find link to
discussion now or bring more details)

-J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2024-10-18 07:58:26 Re: Add isolation test template in injection_points for wait/wakeup/detach
Previous Message Jakub Wartak 2024-10-18 07:49:47 Re: Syncrep and improving latency due to WAL throttling