From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com> |
Cc: | Stephen Frost <sfrost(at)snowman(dot)net>, José Luis Tallón <jltallon(at)adv-solutions(dot)net>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Proposal: two new role attributes and/or capabilities? |
Date: | 2015-01-29 22:02:33 |
Message-ID: | CA+TgmoZz8TbuSy2KfLFhLpxwUP=K=JDwTa7rLSJAnTivZNPr1A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Jan 29, 2015 at 4:09 PM, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com> wrote:
>> The difference between the autovacuum-run vacuum and the cron-run vacuum
>> is that the one running out of cron will just keep holding the lock
>> until it's actually able to truncate the end of the relation, no? I
>> recall discussion previously that we need a way to either support that
>> in autovacuum for (a configurable set of) regular relations or come up
>> with a solution that doesn't require that lock.
>
> AFAICT, in master, there is no difference in truncation between auto and
> manual vacuum. What we do is attempt to acquire the truncation lock for up
> to 5 seconds, giving up after that. Once we do have the lock, we check to
> see how many pages we can actually truncate. During that check, we test
> every ~20ms or so to see if someone else is waiting on our exclusive lock;
> if they are we stop counting and will only truncate the relation up to that
> point.
I don't think this is true, and I don't think it's been true for a
long time, if ever. The difference between a manual vacuum and
autovacuum is that autovacuum commits suicide when it conflicts with
somebody else's lock request, and a manual vacuum doesn't.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2015-01-29 22:06:18 | Re: [COMMITTERS] pgsql: Fix column-privilege leak in error-message paths |
Previous Message | Robert Haas | 2015-01-29 21:59:46 | Re: jsonb, unicode escapes and escaped backslashes |