GIN pending list clean up exposure to SQL

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: GIN pending list clean up exposure to SQL
Date: 2015-08-12 23:19:15
Message-ID: CAMkU=1x8zFkpfnozXyt40zmR3Ub_kHu58LtRmwHUKRgQss7=iQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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?

Cheers,

Jeff

Attachment Content-Type Size
gin_clean_pending_user_v001.patch application/octet-stream 1.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-08-12 23:20:10 Re: Test code is worth the space
Previous Message Tom Lane 2015-08-12 23:11:36 Re: count_nulls(VARIADIC "any")