Re: Slow GRANT ROLE on PostgreSQL 16 with thousands of ROLEs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, alex work <alexwork033(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: Slow GRANT ROLE on PostgreSQL 16 with thousands of ROLEs
Date: 2024-03-25 15:08:39
Message-ID: 2490242.1711379319@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Nathan Bossart <nathandbossart(at)gmail(dot)com> writes:
> Are there any changes you'd like to see for the Bloom patch [0]? I'd like
> to see about getting that committed for v17. One thing that crossed my
> mind is creating a combined list/filter that transparently created a filter
> when necessary (for reuse elsewhere), but I'm not sure that's v17 material.

Yeah, that thought occurred to me too, but I think we ought to have a
few more use-cases in view before trying to write an API.

As for the patch, I agree it could go into v17, but I think there is
still a little bit of work to do:

* The magic constants (crossover list length and bloom filter size)
need some testing to see if there are better values. They should
probably be made into named #defines, too. I suspect, with little
proof, that the bloom filter size isn't particularly critical --- but
I know we pulled the crossover of 1000 out of thin air, and I have
no certainty that it's even within an order of magnitude of being a
good choice.

* Code needs more than zero comments.

* Is it worth trying to make a subroutine, or at least a macro,
so as not to have 2 copies of the code?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2024-03-25 15:09:35 Re: Query on Postgres SQL transaction
Previous Message Nathan Bossart 2024-03-25 14:47:43 Re: Slow GRANT ROLE on PostgreSQL 16 with thousands of ROLEs

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-03-25 15:12:02 Re: Popcount optimization using AVX512
Previous Message Amit Kapila 2024-03-25 15:08:16 Re: pgsql: Track last_inactive_time in pg_replication_slots.