Re: GIN pending list clean up exposure to SQL

From: Oleg Bartunov <obartunov(at)gmail(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Teodor Sigaev <teodor(at)postgrespro(dot)ru>, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
Subject: Re: GIN pending list clean up exposure to SQL
Date: 2015-08-13 03:28:09
Message-ID: CAF4Au4w2sNTAWdGPSEthwc0V4TDsi9SChZcLtxhza_-ie6=BKg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 13, 2015 at 2:19 AM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:

> I've written a function which allows users to clean up the pending list.
> It takes the index name and returns the number of pending list pages
> deleted.
>
> # select * from gin_clean_pending_list('foo_text_array_idx');
> gin_clean_pending_list
> ------------------------
> 278
> (1 row)
>
> Time: 31994.880 ms
>
>
> This is needed because there needs to be a way to offload this duty from
> the user backends, and the only other way to intentionaly clean up the list
> is by vacuum (and the rest of a vacuum can take days to run on a large
> table). Autoanalyze will also do it, but it hard to arrange for those to
> occur at need, and unless you drop default_statistics_target very low they
> can also take a long time. And if you do lower the target, it screws up
> your statistics, of course.
>
> I've currently crammed it into pageinspect, simply because that is where I
> found the existing code which I used as an exemplar for writing this code.
>
> But where does this belong? Core? Its own separate extension?
>

For a long time we have gevel extension (
http://www.sigaev.ru/git/gitweb.cgi?p=gevel.git;a=summary) , which was
originally developed to help us debugging indexes, but it's also contains
user's functions. Your function could be there, but I have no idea about
gevel itself. Probably, it should be restructurized and come to contrib. Do
you have time to look into ?

>
> Cheers,
>
> Jeff
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Vignesh Raghunathan 2015-08-13 04:27:58 Re: Parsing tuple contents
Previous Message Alvaro Herrera 2015-08-13 03:24:29 Re: [COMMITTERS] pgsql: Close some holes in BRIN page assignment