Re: GIN pending list clean up exposure to SQL

Поиск
Список
Период
Сортировка
От Oleg Bartunov
Тема Re: GIN pending list clean up exposure to SQL
Дата
Msg-id CAF4Au4w2sNTAWdGPSEthwc0V4TDsi9SChZcLtxhza_-ie6=BKg@mail.gmail.com
обсуждение исходный текст
Ответ на GIN pending list clean up exposure to SQL  (Jeff Janes <jeff.janes@gmail.com>)
Список pgsql-hackers


On Thu, Aug 13, 2015 at 2:19 AM, Jeff Janes <jeff.janes@gmail.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@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Close some holes in BRIN page assignment
Следующее
От: Vignesh Raghunathan
Дата:
Сообщение: Re: Parsing tuple contents