From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Jeff Davis <pgsql(at)j-davis(dot)com>, Thom Brown <thom(at)linux(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: making EXPLAIN extensible |
Date: | 2025-03-06 21:24:00 |
Message-ID: | CA+TgmoaF3fNJ_ZtAcJcjtoqX1djvvsm2hkSCR6y45NDC_vSaTw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Mar 6, 2025 at 4:16 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> I find a good deal of attraction in getting rid of the IDs and
> just using names. Nor do I believe we need a hash table.
> (1) Surely there will not be so many extensions using this within a
> single EXPLAIN that a simple loop with strcmp()'s isn't good enough.
> (2) The IDs aren't free either; where will an extension keep the
> ID it assigned? We're trying to move away from global variables.
>
> But, if you're convinced otherwise, the current design is OK.
Interesting. I hadn't even considered just iterating every time to
find the ID, but I agree with you that might be totally fine. As you
say, we're not expecting there to be many extensions here. I can try
coding that up and see how it looks (or you can, if you like).
I don't buy your second point, though. Our globals are probably going
to turn into thread-locals at some point, and we may want to do things
like bundle a bunch of related ones together in a struct, but I don't
see any real hope of getting rid of them altogether, and if we do, the
one integer you need to power this kind of extension will hardly be
the biggest problem.
--
Robert Haas
EDB: http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2025-03-06 21:27:45 | Re: what's going on with lapwing? |
Previous Message | Alena Rybakina | 2025-03-06 21:20:38 | Re: explain analyze rows=%.0f |