Michael Lewis <mlewis@xxxxxxxxxxx> writes:
> On Thu, Mar 19, 2020, 5:48 PM David G. Johnston <david.g.johnston@xxxxxxxxx>
> wrote:
>> However, one other consideration with sequences: do you care that
>> PostgreSQL will cache/pin (i.e., no release) every single sequence you
>> touch for the lifetime of the session? (I do not think DISCARD matters here
>> but I'm just guessing)
> Would you expand on this point or is there someplace specific in the
> documentation on this?
I think what David is worried about is that a sequence object is a
one-row table in PG's implementation. Thus
(1) each sequence requires a dozen or two rows in assorted system
catalogs (not sure exactly how many offhand).
Actually I seemed to have missed that dynamic. I was actually referring to the SeqTable hash table specified here:
I wouldn’t think there would be much spreading of data throughout the catalog if the sequences are unowned (by tables).
David J.