Re: query_id: jumble names of temp tables for better pg_stat_statement UX

From: Christoph Berg <myon(at)debian(dot)org>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, ma lz <ma100(at)hotmail(dot)com>
Subject: Re: query_id: jumble names of temp tables for better pg_stat_statement UX
Date: 2025-03-21 16:26:20
Message-ID: Z92TLJ5MmSU_lyxa@msg.df7cb.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Re: Michael Paquier
> I have been thinking about this patch for a couple of days. What
> makes me unhappy in this proposal is that RangeTblEntry is a large and
> complicated Node, and we only want to force a custom computation for
> the "relid" portion of the node, while being able to also take some
> decisions for what the parent node has. Leaving the existing
> per-field query_jumble_ignore with the custom function is prone to
> errors, as well, because we need to maintain some level of consistency
> between parsenodes.h and src/backend/nodes/.

Ack, that was also bothering me, but I didn't think it was so easy to
do it on a per-field level. Thanks!

> The custom functions are named _jumble${node}_${field}, with the field
> and the parent node given as arguments. I agree that giving the field
> is kind of pointless if you have the parent node, but I think that
> this is better so as this forces developers to think about how to use
> the field value with the node.

Makes sense.

> Please see the attached. What do you think?

Just one minor thing, I don't understand what you are trying to say in
this comment:

> +/*
> + * Note that the argument types are enforced for the per-field custom
> + * functions.
> + */
> +#define JUMBLE_CUSTOM(nodetype, item) \
> + _jumble##nodetype##_##item(jstate, expr, expr->item)

Thanks,
Christoph

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Evgeny Morozov 2025-03-21 16:27:11 Querying one partition in a function takes locks on all partitions
Previous Message David G. Johnston 2025-03-21 15:54:55 Re: Disabling vacuum truncate for autovacuum

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2025-03-21 16:28:12 Re: dblink: Add SCRAM pass-through authentication
Previous Message Robert Haas 2025-03-21 16:21:13 Re: Parallel safety for extern params