Re: Improve the performance of the standby server when dropping tables on the primary server

From: "Tokuda, Takashi" <tokuda(dot)takashi(at)jp(dot)fujitsu(dot)com>
To: 'Simon Riggs' <simon(at)2ndquadrant(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Improve the performance of the standby server when dropping tables on the primary server
Date: 2017-08-03 11:31:59
Message-ID: A1CF58A8CBA14341B3F3AC6A468F1845454610C1@g01jpexmbyt23
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> * The previous coding allowed for a fast path to access the last
> unowned relation, which this patch removes. It seems a good idea to
> cache the last unowned relation, or if not explain why the comment
> that says why it worked that way is no longer true.
>
> * We should only create the hash table when needed, i.e. on or after
> when we add an unowned relation, since that is not a typical case.
>
> * The hash table is sized at 400 elements and will grow from there.
> The comments in dynahash say "An overly large nelem will penalize
> hash_seq_search speed without buying much." so this makes your patch
> suitable for the bulk case but likely to perform worse for fewer
> elements. So I'm guessing that you picked 400 because that's what the
> parameter is set to for the smgr relation table rather than because
> this has had good consideration.

I thought abount improving the above problems.
But I have no good ideas to improve every case.
Do you have any good ideas?

I suggest to apply this modification only for the startup process.
This is because the startup process has many unowned SMgrRelation objects.
In XLOG replay, statup process create fake relcaches.
Fake relcaches create unowned SMgrRelation objects.
So startup process has more unowned SMgrRelation objects than any other process.

Of cource, it is necessary to think about the problems such as hash size.
Do you think about it.

Regards, Takashi Tokuda

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2017-08-03 11:36:49 Re: Support for Secure Transport SSL library on macOS as OpenSSL alternative
Previous Message Heikki Linnakangas 2017-08-03 11:06:28 Re: Support for Secure Transport SSL library on macOS as OpenSSL alternative