Re: drop/truncate table sucks for large values of shared buffers
От | Simon Riggs |
---|---|
Тема | Re: drop/truncate table sucks for large values of shared buffers |
Дата | |
Msg-id | CANP8+j+7+q2kBnHhan3hpp=VBR6HLU3yg580n-hGaFYy_UY5ZA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: drop/truncate table sucks for large values of shared buffers (Amit Kapila <amit.kapila16@gmail.com>) |
Ответы |
Re: drop/truncate table sucks for large values of shared buffers
|
Список | pgsql-hackers |
On 1 July 2015 at 15:39, Amit Kapila <amit.kapila16@gmail.com> wrote:
--
Okay. I think we can maintain the list in similar way as we do forUNLINK_RELATION_REQUEST in RememberFsyncRequest(), butwhy to wait till 64 tables?
I meant once per checkpoint cycle OR every N tables, whichever is sooner. N would need to vary according to size of Nbuffers.
We already scan whole buffer list in eachcheckpoint cycle, so during that scan we can refer this dropped relationlist and avoid syncing such buffer contents. Also for ENOENT errorhandling for FileWrite, we can use this list to refer relations for which weneed to ignore the error. I think we are already doing something similar inmdsync to avoid the problem of Dropped tables, so it seems okay tohave it in mdwrite as well.The crucial thing in this idea to think about is avoiding reassignment ofrelfilenode (due to wrapped OID's) before we have ensured that none ofthe buffers contains tag for that relfilenode. Currently we avoid this forFsync case by retaining the first segment of relation (which will avoidreassignment of relfilenode) till checkpoint ends, I think if we just postponeit till we have validated it in shared_buffers, then we can avoid this problemin new scheme and it should be delay of maximum one checkpoint cyclefor unlinking such file assuming we refer dropped relation list in each checkpointcycle during buffer scan.
Yes
So you are keeping more data around for longer, right? I think we would need some way to trigger a scan when the amount of deferred dropped data files hits a certain size.
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
В списке pgsql-hackers по дате отправления: