On Wed, Oct 15, 2025 at 12:56:25PM +1300, David Rowley wrote:
> I tried rewriting the query so that pg_attribute is joined to rather
> than subqueries. With 1500 tables I get:
>
> master:
>
> ignore_system_indexes = on
> Execution Time: 6853.262 ms
>
> ignore_system_indexes = off
> Execution Time: 66.781 ms
>
> Rewritten query:
>
> ignore_system_indexes = on
> Execution Time: 53.351 ms
>
> ignore_system_indexes = off
> Execution Time: 56.965 ms
I tried this with 100K tables and saw the following (ignore_system_indexes
= off):
master:
Planning Time: 1.672 ms
Execution Time: 4077.008 ms
rewritten:
Planning Time: 1.641 ms
Execution Time: 3427.206 ms
I tried this with ignore_system_indexes = on, too, but it was very slow.
--
nathan