Re: Experimenting with hash tables inside pg_dump - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Experimenting with hash tables inside pg_dump
Date
Msg-id 20211022152159.gkwmela2s7ozv4ko@alap3.anarazel.de
Whole thread Raw
In response to Re: Experimenting with hash tables inside pg_dump  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Experimenting with hash tables inside pg_dump
List pgsql-hackers
Hi,

On 2021-10-22 10:53:31 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > On 2021-10-21 22:13:22 -0400, Tom Lane wrote:
> >> I've thought about doing something like
> >> SELECT unsafe-functions FROM pg_class WHERE oid IN (someoid, someoid, ...)
> >> but in cases with tens of thousands of tables, it seems unlikely that
> >> that's going to behave all that nicely.
> 
> > That's kinda what I'm doing in the quick hack. But instead of using IN(...) I
> > made it unnest('{oid, oid, ...}'), that scales much better.
> 
> I'm skeptical of that, mainly because it doesn't work in old servers,
> and I really don't want to maintain two fundamentally different
> versions of getTableAttrs().  I don't think you actually need the
> multi-array form of unnest() here --- we know the TableInfo array
> is in OID order --- but even the single-array form only works
> back to 8.4.

I think we can address that, if we think it's overall a promising approach to
pursue. E.g. if we don't need the indexes, we can make it = ANY().


> However ... looking through getTableAttrs' main query, it seems
> like the only thing there that's potentially unsafe is the
> "format_type(t.oid, a.atttypmod)" call.

I assume the default expression bit would also be unsafe?

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Experimenting with hash tables inside pg_dump
Next
From: vignesh C
Date:
Subject: Re: Added schema level support for publication.