Re: cost based vacuum (parallel)

2019-11-17 Thread Masahiko Sawada
On Fri, 15 Nov 2019 at 11:54, Amit Kapila wrote: > > On Wed, Nov 13, 2019 at 10:02 AM Masahiko Sawada > wrote: > > > > I've done some tests while changing shared buffer size, delays and > > number of workers. The overall results has the similar tendency as the > > result shared by Dilip and looks

Re: cost based vacuum (parallel)

2019-11-15 Thread Dilip Kumar
On Thu, Nov 14, 2019 at 5:02 PM Mahendra Singh wrote: > > On Mon, 11 Nov 2019 at 17:56, Amit Kapila wrote: > > > > On Mon, Nov 11, 2019 at 5:14 PM Dilip Kumar wrote: > > > > > > On Mon, Nov 11, 2019 at 4:23 PM Amit Kapila > > > wrote: > > > > > > > > .. > > > > > I have tested the same with so

Re: cost based vacuum (parallel)

2019-11-14 Thread Amit Kapila
On Wed, Nov 13, 2019 at 10:02 AM Masahiko Sawada wrote: > > I've done some tests while changing shared buffer size, delays and > number of workers. The overall results has the similar tendency as the > result shared by Dilip and looks reasonable to me. > Thanks, Sawada-san for repeating the tests

Re: cost based vacuum (parallel)

2019-11-14 Thread Mahendra Singh
On Mon, 11 Nov 2019 at 17:56, Amit Kapila wrote: > > On Mon, Nov 11, 2019 at 5:14 PM Dilip Kumar wrote: > > > > On Mon, Nov 11, 2019 at 4:23 PM Amit Kapila wrote: > > > > > > .. > > > > I have tested the same with some other workload(test file attached). > > > > I can see the same behaviour with

Re: cost based vacuum (parallel)

2019-11-12 Thread Masahiko Sawada
On Tue, 12 Nov 2019 at 20:22, Masahiko Sawada wrote: > > On Tue, 12 Nov 2019 at 19:08, Amit Kapila wrote: > > > > On Tue, Nov 12, 2019 at 3:03 PM Dilip Kumar wrote: > > > > > > On Tue, Nov 12, 2019 at 10:47 AM Dilip Kumar > > > wrote: > > > > > > > > On Mon, Nov 11, 2019 at 4:23 PM Amit Kapila

Re: cost based vacuum (parallel)

2019-11-12 Thread Masahiko Sawada
On Tue, 12 Nov 2019 at 19:08, Amit Kapila wrote: > > On Tue, Nov 12, 2019 at 3:03 PM Dilip Kumar wrote: > > > > On Tue, Nov 12, 2019 at 10:47 AM Dilip Kumar wrote: > > > > > > On Mon, Nov 11, 2019 at 4:23 PM Amit Kapila > > > wrote: > > > > > > > > On Mon, Nov 11, 2019 at 12:59 PM Dilip Kumar

Re: cost based vacuum (parallel)

2019-11-12 Thread Amit Kapila
On Tue, Nov 12, 2019 at 3:03 PM Dilip Kumar wrote: > > On Tue, Nov 12, 2019 at 10:47 AM Dilip Kumar wrote: > > > > On Mon, Nov 11, 2019 at 4:23 PM Amit Kapila wrote: > > > > > > On Mon, Nov 11, 2019 at 12:59 PM Dilip Kumar > > > wrote: > > > > > > > > On Mon, Nov 11, 2019 at 9:43 AM Dilip Kuma

Re: cost based vacuum (parallel)

2019-11-12 Thread Dilip Kumar
On Tue, Nov 12, 2019 at 10:47 AM Dilip Kumar wrote: > > On Mon, Nov 11, 2019 at 4:23 PM Amit Kapila wrote: > > > > On Mon, Nov 11, 2019 at 12:59 PM Dilip Kumar wrote: > > > > > > On Mon, Nov 11, 2019 at 9:43 AM Dilip Kumar wrote: > > > > > > > > On Fri, Nov 8, 2019 at 11:49 AM Amit Kapila > >

Re: cost based vacuum (parallel)

2019-11-11 Thread Dilip Kumar
On Mon, Nov 11, 2019 at 4:23 PM Amit Kapila wrote: > > On Mon, Nov 11, 2019 at 12:59 PM Dilip Kumar wrote: > > > > On Mon, Nov 11, 2019 at 9:43 AM Dilip Kumar wrote: > > > > > > On Fri, Nov 8, 2019 at 11:49 AM Amit Kapila > > > wrote: > > > > > > > > > > > > Yeah, I think it is difficult to ge

Re: cost based vacuum (parallel)

2019-11-11 Thread Amit Kapila
On Mon, Nov 11, 2019 at 5:14 PM Dilip Kumar wrote: > > On Mon, Nov 11, 2019 at 4:23 PM Amit Kapila wrote: > > > > .. > > > I have tested the same with some other workload(test file attached). > > > I can see the same behaviour with this workload as well that with the > > > patch 4 the distributio

Re: cost based vacuum (parallel)

2019-11-11 Thread Dilip Kumar
On Mon, Nov 11, 2019 at 4:23 PM Amit Kapila wrote: > > On Mon, Nov 11, 2019 at 12:59 PM Dilip Kumar wrote: > > > > On Mon, Nov 11, 2019 at 9:43 AM Dilip Kumar wrote: > > > > > > On Fri, Nov 8, 2019 at 11:49 AM Amit Kapila > > > wrote: > > > > > > > > > > > > Yeah, I think it is difficult to ge

Re: cost based vacuum (parallel)

2019-11-11 Thread Amit Kapila
On Mon, Nov 11, 2019 at 12:59 PM Dilip Kumar wrote: > > On Mon, Nov 11, 2019 at 9:43 AM Dilip Kumar wrote: > > > > On Fri, Nov 8, 2019 at 11:49 AM Amit Kapila wrote: > > > > > > > > > Yeah, I think it is difficult to get the exact balance, but we can try > > > to be as close as possible. We can

Re: cost based vacuum (parallel)

2019-11-10 Thread Dilip Kumar
On Mon, Nov 11, 2019 at 9:43 AM Dilip Kumar wrote: > > On Fri, Nov 8, 2019 at 11:49 AM Amit Kapila wrote: > > > > On Fri, Nov 8, 2019 at 9:39 AM Dilip Kumar wrote: > > > > > > I have done some experiments on this line. I have first produced a > > > case where we can show the problem with the ex

Re: cost based vacuum (parallel)

2019-11-10 Thread Dilip Kumar
On Fri, Nov 8, 2019 at 11:49 AM Amit Kapila wrote: > > On Fri, Nov 8, 2019 at 9:39 AM Dilip Kumar wrote: > > > > I have done some experiments on this line. I have first produced a > > case where we can show the problem with the existing shared costing > > patch (worker which is doing less I/O mi

Re: cost based vacuum (parallel)

2019-11-07 Thread Amit Kapila
On Fri, Nov 8, 2019 at 9:39 AM Dilip Kumar wrote: > > I have done some experiments on this line. I have first produced a > case where we can show the problem with the existing shared costing > patch (worker which is doing less I/O might pay the penalty on behalf > of the worker who is doing more

Re: cost based vacuum (parallel)

2019-11-07 Thread Dilip Kumar
On Fri, Nov 8, 2019 at 8:37 AM Amit Kapila wrote: >> On Fri, Nov 8, 2019 at 8:18 AM Masahiko Sawada > wrote: > > > > On Wed, 6 Nov 2019 at 15:45, Amit Kapila wrote: > > > > > > On Tue, Nov 5, 2019 at 11:28 AM Amit Kapila > > > wrote: > > > > > > > > On Mon, Nov 4, 2019 at 11:42 PM Andres Freun

Re: cost based vacuum (parallel)

2019-11-07 Thread Amit Kapila
On Fri, Nov 8, 2019 at 8:18 AM Masahiko Sawada wrote: > > On Wed, 6 Nov 2019 at 15:45, Amit Kapila wrote: > > > > On Tue, Nov 5, 2019 at 11:28 AM Amit Kapila wrote: > > > > > > On Mon, Nov 4, 2019 at 11:42 PM Andres Freund wrote: > > > > > > > > > > > > > The two approaches to solve this proble

Re: cost based vacuum (parallel)

2019-11-07 Thread Masahiko Sawada
On Wed, 6 Nov 2019 at 15:45, Amit Kapila wrote: > > On Tue, Nov 5, 2019 at 11:28 AM Amit Kapila wrote: > > > > On Mon, Nov 4, 2019 at 11:42 PM Andres Freund wrote: > > > > > > > > > > The two approaches to solve this problem being discussed in that > > > > thread [1] are as follows: > > > > (a)

Re: cost based vacuum (parallel)

2019-11-06 Thread Dilip Kumar
On Wed, Nov 6, 2019 at 9:21 AM Stephen Frost wrote: > > Greetings, > > * Amit Kapila (amit.kapil...@gmail.com) wrote: > > On Tue, Nov 5, 2019 at 1:42 AM Stephen Frost wrote: > > > * Andres Freund (and...@anarazel.de) wrote: > > > > That's quite doable independent of parallelism, as we don't have

Re: cost based vacuum (parallel)

2019-11-05 Thread Amit Kapila
On Tue, Nov 5, 2019 at 11:28 AM Amit Kapila wrote: > > On Mon, Nov 4, 2019 at 11:42 PM Andres Freund wrote: > > > > > > > The two approaches to solve this problem being discussed in that > > > thread [1] are as follows: > > > (a) Allow the parallel workers and master backend to have a shared > >

Re: cost based vacuum (parallel)

2019-11-05 Thread Stephen Frost
Greetings, * Amit Kapila (amit.kapil...@gmail.com) wrote: > On Tue, Nov 5, 2019 at 1:42 AM Stephen Frost wrote: > > * Andres Freund (and...@anarazel.de) wrote: > > > That's quite doable independent of parallelism, as we don't have tables > > > or indexes spanning more than one tablespace. True,

Re: cost based vacuum (parallel)

2019-11-05 Thread Amit Kapila
On Wed, Nov 6, 2019 at 7:55 AM Andres Freund wrote: > > Hi, > > On 2019-11-06 07:53:09 +0530, Amit Kapila wrote: > > As per feedback in this thread, it seems that for now, it is better, > > if we can allow a parallel vacuum only when I/O throttling is not > > enabled. We can later extend it based

Re: cost based vacuum (parallel)

2019-11-05 Thread Andres Freund
Hi, On 2019-11-06 07:53:09 +0530, Amit Kapila wrote: > As per feedback in this thread, it seems that for now, it is better, > if we can allow a parallel vacuum only when I/O throttling is not > enabled. We can later extend it based on feedback from the field once > the feature starts getting used

Re: cost based vacuum (parallel)

2019-11-05 Thread Amit Kapila
On Tue, Nov 5, 2019 at 1:42 AM Stephen Frost wrote: > * Andres Freund (and...@anarazel.de) wrote: > > > That's quite doable independent of parallelism, as we don't have tables > > or indexes spanning more than one tablespace. True, you could then make > > the processing of an individual vacuum fa

Re: cost based vacuum (parallel)

2019-11-05 Thread Dilip Kumar
On Tue, Nov 5, 2019 at 8:49 PM Andres Freund wrote: > > Hi, > > On November 5, 2019 7:16:41 AM PST, Dilip Kumar wrote: > >On Tue, Nov 5, 2019 at 2:40 PM Amit Kapila > >wrote: > >> > >> On Mon, Nov 4, 2019 at 11:58 PM Andres Freund > >wrote: > >> > > >> > Hi, > >> > > >> > On 2019-11-04 12:59:02

Re: cost based vacuum (parallel)

2019-11-05 Thread Andres Freund
Hi, On November 5, 2019 7:16:41 AM PST, Dilip Kumar wrote: >On Tue, Nov 5, 2019 at 2:40 PM Amit Kapila >wrote: >> >> On Mon, Nov 4, 2019 at 11:58 PM Andres Freund >wrote: >> > >> > Hi, >> > >> > On 2019-11-04 12:59:02 -0500, Jeff Janes wrote: >> > > On Mon, Nov 4, 2019 at 1:54 AM Amit Kapila >

Re: cost based vacuum (parallel)

2019-11-05 Thread Dilip Kumar
On Tue, Nov 5, 2019 at 2:40 PM Amit Kapila wrote: > > On Mon, Nov 4, 2019 at 11:58 PM Andres Freund wrote: > > > > Hi, > > > > On 2019-11-04 12:59:02 -0500, Jeff Janes wrote: > > > On Mon, Nov 4, 2019 at 1:54 AM Amit Kapila > > > wrote: > > > > > > > For parallel vacuum [1], we were discussing

Re: cost based vacuum (parallel)

2019-11-05 Thread Amit Kapila
On Tue, Nov 5, 2019 at 1:12 AM Andres Freund wrote: > On 2019-11-04 14:33:41 -0500, Stephen Frost wrote: > > > I've been wondering if the accounting system should consider the cost > > per tablespace when there's multiple tablespaces involved, instead of > > throttling the overall process without

Re: cost based vacuum (parallel)

2019-11-05 Thread Amit Kapila
On Mon, Nov 4, 2019 at 11:58 PM Andres Freund wrote: > > Hi, > > On 2019-11-04 12:59:02 -0500, Jeff Janes wrote: > > On Mon, Nov 4, 2019 at 1:54 AM Amit Kapila wrote: > > > > > For parallel vacuum [1], we were discussing what is the best way to > > > divide the cost among parallel workers but we

Re: cost based vacuum (parallel)

2019-11-04 Thread Amit Kapila
On Mon, Nov 4, 2019 at 11:42 PM Andres Freund wrote: > > > > The two approaches to solve this problem being discussed in that > > thread [1] are as follows: > > (a) Allow the parallel workers and master backend to have a shared > > view of vacuum cost related parameters (mainly VacuumCostBalance)

Re: cost based vacuum (parallel)

2019-11-04 Thread Stephen Frost
Greetings, * Andres Freund (and...@anarazel.de) wrote: > On 2019-11-04 14:33:41 -0500, Stephen Frost wrote: > > * Andres Freund (and...@anarazel.de) wrote: > > > On 2019-11-04 14:06:19 -0500, Stephen Frost wrote: > > > > With parallelization across indexes, you could have a situation where > > > >

Re: cost based vacuum (parallel)

2019-11-04 Thread Andres Freund
Hi, On 2019-11-04 14:33:41 -0500, Stephen Frost wrote: > * Andres Freund (and...@anarazel.de) wrote: > > On 2019-11-04 14:06:19 -0500, Stephen Frost wrote: > > > With parallelization across indexes, you could have a situation where > > > the individual indexes are on different tablespaces with ind

Re: cost based vacuum (parallel)

2019-11-04 Thread Stephen Frost
Greetings, * Andres Freund (and...@anarazel.de) wrote: > On 2019-11-04 14:06:19 -0500, Stephen Frost wrote: > > * Jeff Janes (jeff.ja...@gmail.com) wrote: > > > On Mon, Nov 4, 2019 at 1:54 AM Amit Kapila > > > wrote: > > > > For parallel vacuum [1], we were discussing what is the best way to > >

Re: cost based vacuum (parallel)

2019-11-04 Thread Andres Freund
Hi, On 2019-11-04 14:06:19 -0500, Stephen Frost wrote: > * Jeff Janes (jeff.ja...@gmail.com) wrote: > > On Mon, Nov 4, 2019 at 1:54 AM Amit Kapila wrote: > > > For parallel vacuum [1], we were discussing what is the best way to > > > divide the cost among parallel workers but we didn't get many i

Re: cost based vacuum (parallel)

2019-11-04 Thread Stephen Frost
Greetings, * Jeff Janes (jeff.ja...@gmail.com) wrote: > On Mon, Nov 4, 2019 at 1:54 AM Amit Kapila wrote: > > For parallel vacuum [1], we were discussing what is the best way to > > divide the cost among parallel workers but we didn't get many inputs > > apart from people who are very actively in

Re: cost based vacuum (parallel)

2019-11-04 Thread Andres Freund
Hi, On 2019-11-04 12:59:02 -0500, Jeff Janes wrote: > On Mon, Nov 4, 2019 at 1:54 AM Amit Kapila wrote: > > > For parallel vacuum [1], we were discussing what is the best way to > > divide the cost among parallel workers but we didn't get many inputs > > apart from people who are very actively in

Re: cost based vacuum (parallel)

2019-11-04 Thread Andres Freund
Hi, On 2019-11-04 12:24:35 +0530, Amit Kapila wrote: > For parallel vacuum [1], we were discussing what is the best way to > divide the cost among parallel workers but we didn't get many inputs > apart from people who are very actively involved in patch development. > I feel that we need some more

Re: cost based vacuum (parallel)

2019-11-04 Thread Jeff Janes
On Mon, Nov 4, 2019 at 1:54 AM Amit Kapila wrote: > For parallel vacuum [1], we were discussing what is the best way to > divide the cost among parallel workers but we didn't get many inputs > apart from people who are very actively involved in patch development. > I feel that we need some more i

Re: cost based vacuum (parallel)

2019-11-04 Thread Masahiko Sawada
On Mon, 4 Nov 2019 at 19:26, Amit Kapila wrote: > > On Mon, Nov 4, 2019 at 1:51 PM Masahiko Sawada wrote: > > > > On Mon, Nov 4, 2019 at 3:54 PM Amit Kapila wrote: > > > > > > I think approach-2 is better in throttling the system as it doesn't > > > have the drawback of the first approach, but i

Re: cost based vacuum (parallel)

2019-11-04 Thread Amit Kapila
On Mon, Nov 4, 2019 at 1:03 PM Darafei "Komяpa" Praliaskouski wrote: >> >> >> This is somewhat similar to a memory usage problem with a >> parallel query where each worker is allowed to use up to work_mem of >> memory. We can say that the users using parallel operation can expect >> more system r

Re: cost based vacuum (parallel)

2019-11-04 Thread Amit Kapila
On Mon, Nov 4, 2019 at 1:51 PM Masahiko Sawada wrote: > > On Mon, Nov 4, 2019 at 3:54 PM Amit Kapila wrote: > > > > I think approach-2 is better in throttling the system as it doesn't > > have the drawback of the first approach, but it might be a bit tricky > > to implement. > > I might be missin

Re: cost based vacuum (parallel)

2019-11-04 Thread Masahiko Sawada
On Mon, Nov 4, 2019 at 3:54 PM Amit Kapila wrote: > > I think approach-2 is better in throttling the system as it doesn't > have the drawback of the first approach, but it might be a bit tricky > to implement. I might be missing something but I think that there could be the drawback of the approa

Re: cost based vacuum (parallel)

2019-11-03 Thread Komяpa
> > > This is somewhat similar to a memory usage problem with a > parallel query where each worker is allowed to use up to work_mem of > memory. We can say that the users using parallel operation can expect > more system resources to be used as they want to get the operation > done faster, so we a

cost based vacuum (parallel)

2019-11-03 Thread Amit Kapila
For parallel vacuum [1], we were discussing what is the best way to divide the cost among parallel workers but we didn't get many inputs apart from people who are very actively involved in patch development. I feel that we need some more inputs before we finalize anything, so starting a new thread.