RT homepage and ticket slow for privilegied user but fast as root after migration to Debian 12

Hello and happy new year everyone,

I try to migrate my RT 5.0.5 instance from Debian 11, postgresql 13 to Debian 12, postgresql 15.

The migrate process is fine but at the end i have a poor performance on RT when logged as privilegied user. Homepage and tickets are slow to show.
Everything is normal when logged as root user.
I have see other tread with this symptom but wihtout solution.

I think it’s an issue with database more thant apache.

What i try:
Reindex database (nothing better)
export PGOPTIONS=“-P”
psql rt5;
REINDEX DATABASE rt5;
\q

Resenquence number of line with the RT tools(nothing better):
/opt/rt5/etc/upgrade/reset-sequences

Validate the database with the RT tools (no issue found):
/opt/rt5/sbin/rt-validator --check

Disable all plugin and restart apache2 (nothing better).

The only thing worked is to change de Set($UseSQLForACLChecks, 0); value.

But it’s doesnt seems to be a good solution from the manual:
#$UseSQLForACLChecks
Historically, ACLs were checked on display, which could lead to empty search pages and wrong ticket counts. Set $UseSQLForACLChecks to 0 to go back to this method; this will reduce the complexity of the generated SQL statements, at the cost of the aforementioned bugs.

Have you any advice on this issue (i work on the clone of my instance, i can try and break thing if needed)?

Kind regards,
Periway

Self reply:

I have make a dump / drop and import database as described in official documentation (backup and restore postgresql). This seems to solve the performance issue.
I still dont know from where this problem came, but that’s enougth for me.

https://docs.bestpractical.com/rt/5.0.5/system_administration/database.html#PostgreSQL

So no more the change of $UseSQLForACLChecks is not necessary.

If someone have the technical clue who can explain that magic voodoo, i’m curius to know.

Kind regards,