Re: reloption to prevent VACUUM from truncating empty pages at theend of relation
От
Fujii Masao
Тема
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation
Дата
Msg-id
CAHGQGwHq1uYRoxMtr84eKrARSA_G7YcOSE9TuSLNnxp2LbjmFQ@mail.gmail.com
Ответ на
Список
Дерево обсуждения
reloption to prevent VACUUM from truncating empty pages at the end of relation Fujii Masao <masao.fujii@gmail.com>
RE: reloption to prevent VACUUM from truncating empty pages at theend of relation "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Re: reloption to prevent VACUUM from truncating empty pages at the end of relation Tom Lane <tgl@sss.pgh.pa.us>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: reloption to prevent VACUUM from truncating empty pages at the end of relation Tom Lane <tgl@sss.pgh.pa.us>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Andres Freund <andres@anarazel.de>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Michael Paquier <michael@paquier.xyz>
Re: reloption to prevent VACUUM from truncating empty pages at the end of relation Andres Freund <andres@anarazel.de>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Michael Paquier <michael@paquier.xyz>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Andres Freund <andres@anarazel.de>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Amit Kapila <amit.kapila16@gmail.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Michael Paquier <michael@paquier.xyz>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Andres Freund <andres@anarazel.de>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Pavel Stehule <pavel.stehule@gmail.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Laurenz Albe <laurenz.albe@cybertec.at>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Alvaro Herrera <alvherre@2ndquadrant.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Amit Kapila <amit.kapila16@gmail.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Michael Paquier <michael@paquier.xyz>
RE: reloption to prevent VACUUM from truncating empty pages at theend of relation "Jamison, Kirk" <k.jamison@jp.fujitsu.com>
RE: reloption to prevent VACUUM from truncating empty pages at theend of relation "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
RE: reloption to prevent VACUUM from truncating empty pages at theend of relation "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
RE: reloption to prevent VACUUM from truncating empty pages at theend of relation "Jamison, Kirk" <k.jamison@jp.fujitsu.com>
RE: reloption to prevent VACUUM from truncating empty pages at theend of relation "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Laurenz Albe <laurenz.albe@cybertec.at>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Michael Paquier <michael@paquier.xyz>
RE: reloption to prevent VACUUM from truncating empty pages at theend of relation "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Julien Rouhaud <rjuju123@gmail.com>
RE: reloption to prevent VACUUM from truncating empty pages at theend of relation "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Michael Paquier <michael@paquier.xyz>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Julien Rouhaud <rjuju123@gmail.com>
RE: reloption to prevent VACUUM from truncating empty pages at theend of relation "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Michael Paquier <michael@paquier.xyz>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Masahiko Sawada <sawada.mshk@gmail.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Michael Paquier <michael@paquier.xyz>
RE: reloption to prevent VACUUM from truncating empty pages at theend of relation "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Masahiko Sawada <sawada.mshk@gmail.com>
RE: reloption to prevent VACUUM from truncating empty pages at theend of relation "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Masahiko Sawada <sawada.mshk@gmail.com>
RE: reloption to prevent VACUUM from truncating empty pages at theend of relation "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Julien Rouhaud <rjuju123@gmail.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Michael Paquier <michael@paquier.xyz>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Robert Haas <robertmhaas@gmail.com>
RE: reloption to prevent VACUUM from truncating empty pages at theend of relation "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Michael Paquier <michael@paquier.xyz>
RE: reloption to prevent VACUUM from truncating empty pages at theend of relation "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Alvaro Herrera <alvherre@2ndquadrant.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Laurenz Albe <laurenz.albe@cybertec.at>
RE: reloption to prevent VACUUM from truncating empty pages at theend of relation "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Robert Haas <robertmhaas@gmail.com>
Re: reloption to prevent VACUUM from truncating empty pages at the end of relation Tom Lane <tgl@sss.pgh.pa.us>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: reloption to prevent VACUUM from truncating empty pages at the end of relation Tom Lane <tgl@sss.pgh.pa.us>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Masahiko Sawada <sawada.mshk@gmail.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation "Bossart, Nathan" <bossartn@amazon.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Andres Freund <andres@anarazel.de>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation "Bossart, Nathan" <bossartn@amazon.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Andres Freund <andres@anarazel.de>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation "Bossart, Nathan" <bossartn@amazon.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Andres Freund <andres@anarazel.de>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation "Bossart, Nathan" <bossartn@amazon.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Masahiko Sawada <sawada.mshk@gmail.com>
Re: Re: reloption to prevent VACUUM from truncating empty pages atthe end of relation David Steele <david@pgmasters.net>
RE: Re: reloption to prevent VACUUM from truncating empty pages atthe end of relation "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Re: Re: reloption to prevent VACUUM from truncating empty pages atthe end of relation Robert Haas <robertmhaas@gmail.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Laurenz Albe <laurenz.albe@cybertec.at>
Re: reloption to prevent VACUUM from truncating empty pages at the end of relation Tom Lane <tgl@sss.pgh.pa.us>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Alvaro Herrera <alvherre@2ndquadrant.com>
Re: reloption to prevent VACUUM from truncating empty pages at the end of relation Tom Lane <tgl@sss.pgh.pa.us>
Re: reloption to prevent VACUUM from truncating empty pages at the end of relation Sergei Kornilov <sk@zsrv.org>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Andres Freund <andres@anarazel.de>
Re: reloption to prevent VACUUM from truncating empty pages at the end of relation Tom Lane <tgl@sss.pgh.pa.us>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Andres Freund <andres@anarazel.de>
Re: reloption to prevent VACUUM from truncating empty pages at the end of relation Tom Lane <tgl@sss.pgh.pa.us>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Simon Riggs <simon@2ndquadrant.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Peter Geoghegan <pg@bowt.ie>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Pavan Deolasee <pavan.deolasee@gmail.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Fujii Masao <masao.fujii@gmail.com>
Re: reloption to prevent VACUUM from truncating empty pages at theend of relation Pavan Deolasee <pavan.deolasee@gmail.com>
Re: reloption to prevent VACUUM from truncating empty pages at the end of relation Tom Lane <tgl@sss.pgh.pa.us>
Re: reloption to prevent VACUUM from truncating empty pages at the end of relation Tom Lane <tgl@sss.pgh.pa.us>
On Wed, Apr 18, 2018 at 11:29 PM, Pavan Deolasee wrote: > > > On Tue, Apr 17, 2018 at 11:05 PM, Fujii Masao wrote: >> >> Hi, >> >> I'd like to propose to add $SUBJECT for performance improvement. >> >> When VACUUM tries to truncate the trailing empty pages, it scans >> shared_buffers >> to invalidate the pages-to-truncate during holding an AccessExclusive lock >> on >> the relation. So if shared_buffers is huge, other transactions need to >> wait for >> a very long time before accessing to the relation. Which would cause the >> response-time spikes, for example, I observed such spikes several times on >> the server with shared_buffers = 300GB while running the benchmark. >> Therefore, I'm thinking to propose $SUBJECT and enable it to avoid such >> spikes >> for that relation. > > > Alvaro reminded me that we already have a mechanism in place which forces > VACUUM to give up the exclusive lock if another backend is waiting on the > lock for more than certain pre-defined duration. AFAICS we give up the lock, > but again retry truncation from the previously left off position. What if we > make that lock-wait duration configurable on a per-table basis? And may be a > special value to never truncate (though it seems quite excessive to me and a > possible footgun) I'm not sure if it's safe to cancel forcibly VACUUM's truncation during scaning shared_buffers. That scan happens after WAL-logging and before the actual truncation. > I was actually thinking in the other direction. So between the time VACUUM > figures out it can possibly truncate last K pages, some backend may insert a > tuple in some page and make the truncation impossible. What if we truncate > the FSM before starting the backward scan so that new inserts go into the > pages prior to the truncation point, if possible. That will increase the > chances of VACUUM being able to truncate all the empty pages. Though I think > in some cases it might lead to unnecessary further extension of the > relation. May be we use some heuristic based on available free space in the > table prior to the truncation point? Isn't this too complicated? I wonder what heuristic we can use here. Regards, -- Fujii Masao
В списке pgsql-hackers по дате отправления