Re: Postgres is not able to handle more than 4k tables!? - Mailing list pgsql-hackers

From Konstantin Knizhnik
Subject Re: Postgres is not able to handle more than 4k tables!?
Date
Msg-id 9d5749c4-641d-dce0-83a7-b6d61348ffa4@postgrespro.ru
Whole thread Raw
In response to Re: Postgres is not able to handle more than 4k tables!?  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: Postgres is not able to handle more than 4k tables!?  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers

On 15.07.2020 02:17, Alvaro Herrera wrote:
> On 2020-Jul-10, Konstantin Knizhnik wrote:
>
>> @@ -3076,6 +3080,10 @@ relation_needs_vacanalyze(Oid relid,
>>           instuples = tabentry->inserts_since_vacuum;
>>           anltuples = tabentry->changes_since_analyze;
>>   
>> +        rel = RelationIdGetRelation(relid);
>> +        oldestXmin = TransactionIdLimitedForOldSnapshots(GetOldestXmin(rel, PROCARRAY_FLAGS_VACUUM), rel);
>> +        RelationClose(rel);
> *cough*
>
Sorry, Alvaro.
Can you explain this *cough*
You didn't like that relation is opened  just to call GetOldestXmin?
But this functions requires Relation. Do you suggest to rewrite it so 
that it is possible to pass just Oid of relation?

Or you do you think that such calculation of oldestSmin is obscure and 
at lest requires some comment?
Actually, I have copied it from vacuum.c and there is a large comment 
explaining why it is calculated in this  way.
May be it is enough to add reference to vacuum.c?
Or may be create some special function for it?
I just need to oldestXmin in calculated in the same way in vacuum.c and 
autovacuum.c




pgsql-hackers by date:

Previous
From: Jehan-Guillaume de Rorthais
Date:
Subject: BUG #15285: Query used index over field with ICU collation in some cases wrongly return 0 rows
Next
From: Alvaro Herrera
Date:
Subject: Re: Postgres is not able to handle more than 4k tables!?