pg.ddx.io  pgsql-patches@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Teodor Sigaev <teodor@sigaev.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Oleg Bartunov <oleg@sai.msu.su>
Cc: Pgsql Hackers <pgsql-hackers@postgresql.org>
Subject: Re: [PATCHES] GIN improvements
Date: Tue, 22 Jul 2008 22:24:40 +0400
Message-ID: <488625E8.4070203@sigaev.ru> (raw)
In-Reply-To: <1636.1216749010@sss.pgh.pa.us>
References: <483FD205.4090904@sigaev.ru>
	<486BC501.6060605@sigaev.ru>
	<27880.1215810535@sss.pgh.pa.us>
	<487A6E0C.3090600@sigaev.ru>
	<29437.1216742605@sss.pgh.pa.us>
	<48861758.4070507@sigaev.ru>
	<1636.1216749010@sss.pgh.pa.us>

> Well, if that is required to be true then this whole design is pretty
> broken, because VACUUM doesn't hold any lock that would guarantee that
> no insert happens between the two calls.  If we fold the two AM calls
> into one call then it'd be okay for the index AM to take such a lock
> transiently during the single index-cleanup-plus-bulkdelete call.
Actually, lock doesn't needed. Just bulkdelete should not try to remove not yet 
"insertcleanuped" items pointer. That's easy because VacPageList is prepared 
before insertcleanup call.


> Maybe it'd be better if ambulkdelete *did* scan the pending list?

I don't like that idea because it requires to add a lot of code (concurrent 
deletion of pages in list), much simpler to call insertcleanup inside 
ginbulkdelete/ginvacuumcleanup.

> You'd still need at least page-level locking but perhaps not anything
> stronger.

That's close to trivial to revert this piece to add cleanup call to 
ginbulkdelete/ginvacuumcleanup. Early variants used this variant.
Reasons for new variant was:
  - defining needing of call of insertcleanup, and stats argument was used for
    it in both function. If it's a NULL then call cleanup.
  - I thought about statistic-based trigger for separate call of insertcleanup.
    Trigger should be fired on massive insert/update events very similar to
    trigger on massive delete for ambulkdelete. I'm very sorry but I didn't do it
    yet, and definitely I need some help here.

Do I revert that piece?

-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
                                                    WWW: http://www.sigaev.ru/



view thread (74+ messages)  latest in thread

Message-ID: <488625E8.4070203@sigaev.ru>
Permalink:  ../488625E8.4070203@sigaev.ru/
Also on:    postgresql.org/message-id/488625E8.4070203@sigaev.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-patches@postgresql.org
  Cc: teodor@sigaev.ru, tgl@sss.pgh.pa.us, oleg@sai.msu.su, pgsql-hackers@postgresql.org
  Subject: Re: [PATCHES] GIN improvements
  In-Reply-To: <488625E8.4070203@sigaev.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox