Re: adding wait_start column to pg_locks

2021-02-22 Thread Fujii Masao
On 2021/02/18 16:26, torikoshia wrote: On 2021-02-16 16:59, Fujii Masao wrote: On 2021/02/15 15:17, Fujii Masao wrote: On 2021/02/10 10:43, Fujii Masao wrote: On 2021/02/09 23:31, torikoshia wrote: On 2021-02-09 22:54, Fujii Masao wrote: On 2021/02/09 19:11, Fujii Masao wrote: On 2

Re: adding wait_start column to pg_locks

2021-02-17 Thread torikoshia
On 2021-02-16 16:59, Fujii Masao wrote: On 2021/02/15 15:17, Fujii Masao wrote: On 2021/02/10 10:43, Fujii Masao wrote: On 2021/02/09 23:31, torikoshia wrote: On 2021-02-09 22:54, Fujii Masao wrote: On 2021/02/09 19:11, Fujii Masao wrote: On 2021/02/09 18:13, Fujii Masao wrote: On 2

Re: adding wait_start column to pg_locks

2021-02-15 Thread Fujii Masao
On 2021/02/15 15:17, Fujii Masao wrote: On 2021/02/10 10:43, Fujii Masao wrote: On 2021/02/09 23:31, torikoshia wrote: On 2021-02-09 22:54, Fujii Masao wrote: On 2021/02/09 19:11, Fujii Masao wrote: On 2021/02/09 18:13, Fujii Masao wrote: On 2021/02/09 17:48, torikoshia wrote: On

Re: adding wait_start column to pg_locks

2021-02-14 Thread Fujii Masao
On 2021/02/10 10:43, Fujii Masao wrote: On 2021/02/09 23:31, torikoshia wrote: On 2021-02-09 22:54, Fujii Masao wrote: On 2021/02/09 19:11, Fujii Masao wrote: On 2021/02/09 18:13, Fujii Masao wrote: On 2021/02/09 17:48, torikoshia wrote: On 2021-02-05 18:49, Fujii Masao wrote: On 2

Re: adding wait_start column to pg_locks

2021-02-09 Thread Fujii Masao
On 2021/02/09 23:31, torikoshia wrote: On 2021-02-09 22:54, Fujii Masao wrote: On 2021/02/09 19:11, Fujii Masao wrote: On 2021/02/09 18:13, Fujii Masao wrote: On 2021/02/09 17:48, torikoshia wrote: On 2021-02-05 18:49, Fujii Masao wrote: On 2021/02/05 0:03, torikoshia wrote: On 2021-0

Re: adding wait_start column to pg_locks

2021-02-09 Thread torikoshia
On 2021-02-09 22:54, Fujii Masao wrote: On 2021/02/09 19:11, Fujii Masao wrote: On 2021/02/09 18:13, Fujii Masao wrote: On 2021/02/09 17:48, torikoshia wrote: On 2021-02-05 18:49, Fujii Masao wrote: On 2021/02/05 0:03, torikoshia wrote: On 2021-02-03 11:23, Fujii Masao wrote: 64-bit fetc

Re: adding wait_start column to pg_locks

2021-02-09 Thread Fujii Masao
On 2021/02/09 19:11, Fujii Masao wrote: On 2021/02/09 18:13, Fujii Masao wrote: On 2021/02/09 17:48, torikoshia wrote: On 2021-02-05 18:49, Fujii Masao wrote: On 2021/02/05 0:03, torikoshia wrote: On 2021-02-03 11:23, Fujii Masao wrote: 64-bit fetches are not atomic on some platforms.

Re: adding wait_start column to pg_locks

2021-02-09 Thread Fujii Masao
On 2021/02/09 18:13, Fujii Masao wrote: On 2021/02/09 17:48, torikoshia wrote: On 2021-02-05 18:49, Fujii Masao wrote: On 2021/02/05 0:03, torikoshia wrote: On 2021-02-03 11:23, Fujii Masao wrote: 64-bit fetches are not atomic on some platforms. So spinlock is necessary when updating "w

Re: adding wait_start column to pg_locks

2021-02-09 Thread Fujii Masao
On 2021/02/09 17:48, torikoshia wrote: On 2021-02-05 18:49, Fujii Masao wrote: On 2021/02/05 0:03, torikoshia wrote: On 2021-02-03 11:23, Fujii Masao wrote: 64-bit fetches are not atomic on some platforms. So spinlock is necessary when updating "waitStart" without holding the partition loc

Re: adding wait_start column to pg_locks

2021-02-09 Thread torikoshia
On 2021-02-05 18:49, Fujii Masao wrote: On 2021/02/05 0:03, torikoshia wrote: On 2021-02-03 11:23, Fujii Masao wrote: 64-bit fetches are not atomic on some platforms. So spinlock is necessary when updating "waitStart" without holding the partition lock? Also GetLockStatusData() needs spinlock

Re: adding wait_start column to pg_locks

2021-02-05 Thread Fujii Masao
On 2021/02/05 0:03, torikoshia wrote: On 2021-02-03 11:23, Fujii Masao wrote: 64-bit fetches are not atomic on some platforms. So spinlock is necessary when updating "waitStart" without holding the partition lock? Also GetLockStatusData() needs spinlock when reading "waitStart"? Also it mi

Re: adding wait_start column to pg_locks

2021-02-04 Thread torikoshia
On 2021-02-03 11:23, Fujii Masao wrote: 64-bit fetches are not atomic on some platforms. So spinlock is necessary when updating "waitStart" without holding the partition lock? Also GetLockStatusData() needs spinlock when reading "waitStart"? Also it might be worth thinking to use 64-bit atomi

Re: adding wait_start column to pg_locks

2021-02-02 Thread Fujii Masao
On 2021/02/03 1:49, Fujii Masao wrote: On 2021/02/02 22:00, torikoshia wrote: On 2021-01-25 23:44, Fujii Masao wrote: Another comment is; Doesn't the change of MyProc->waitStart need the lock table's partition lock? If yes, we can do that by moving LWLockRelease(partitionLock) just after t

Re: adding wait_start column to pg_locks

2021-02-02 Thread Fujii Masao
On 2021/02/02 22:00, torikoshia wrote: On 2021-01-25 23:44, Fujii Masao wrote: Another comment is; Doesn't the change of MyProc->waitStart need the lock table's partition lock? If yes, we can do that by moving LWLockRelease(partitionLock) just after the change of MyProc->waitStart, but which

Re: adding wait_start column to pg_locks

2021-02-02 Thread torikoshia
On 2021-01-25 23:44, Fujii Masao wrote: Another comment is; Doesn't the change of MyProc->waitStart need the lock table's partition lock? If yes, we can do that by moving LWLockRelease(partitionLock) just after the change of MyProc->waitStart, but which causes the time that lwlock is being held t

Re: adding wait_start column to pg_locks

2021-01-25 Thread Fujii Masao
On 2021/01/22 18:11, Fujii Masao wrote: On 2021/01/22 14:37, torikoshia wrote: On 2021-01-21 12:48, Fujii Masao wrote: Thanks for updating the patch! I think that this is really useful feature!! Thanks for reviewing! I have two minor comments. +  +   wait_start timestamptz

Re: adding wait_start column to pg_locks

2021-01-22 Thread Fujii Masao
On 2021/01/22 14:37, torikoshia wrote: On 2021-01-21 12:48, Fujii Masao wrote: Thanks for updating the patch! I think that this is really useful feature!! Thanks for reviewing! I have two minor comments. +  +   wait_start timestamptz The column name "wait_start" should be "wai

Re: adding wait_start column to pg_locks

2021-01-21 Thread torikoshia
On 2021-01-21 12:48, Fujii Masao wrote: Thanks for updating the patch! I think that this is really useful feature!! Thanks for reviewing! I have two minor comments. + role="column_definition"> + wait_start timestamptz The column name "wait_start" should be "waitstart" for the s

Re: adding wait_start column to pg_locks

2021-01-20 Thread Fujii Masao
On 2021/01/18 12:00, torikoshia wrote: On 2021-01-15 15:23, torikoshia wrote: Thanks for your reviewing and comments! On 2021-01-14 12:39, Ian Lawrence Barwick wrote: Looking at the code, this happens as the wait start time is being recorded in the lock record itself, so always contains the

Re: adding wait_start column to pg_locks

2021-01-17 Thread torikoshia
On 2021-01-15 15:23, torikoshia wrote: Thanks for your reviewing and comments! On 2021-01-14 12:39, Ian Lawrence Barwick wrote: Looking at the code, this happens as the wait start time is being recorded in the lock record itself, so always contains the value reported by the latest lock acquis

Re: adding wait_start column to pg_locks

2021-01-14 Thread torikoshia
Thanks for your reviewing and comments! On 2021-01-14 12:39, Ian Lawrence Barwick wrote: Looking at the code, this happens as the wait start time is being recorded in the lock record itself, so always contains the value reported by the latest lock acquisition attempt. I think you are right a

Re: adding wait_start column to pg_locks

2021-01-14 Thread Ian Lawrence Barwick
2021年1月15日(金) 3:45 Robert Haas : > On Wed, Jan 13, 2021 at 10:40 PM Ian Lawrence Barwick > wrote: > > It looks like the logical place to store the value is in the PROCLOCK > > structure; ... > > That seems surprising, because there's one PROCLOCK for every > combination of a process and a lock. B

Re: adding wait_start column to pg_locks

2021-01-14 Thread Robert Haas
On Wed, Jan 13, 2021 at 10:40 PM Ian Lawrence Barwick wrote: > It looks like the logical place to store the value is in the PROCLOCK > structure; ... That seems surprising, because there's one PROCLOCK for every combination of a process and a lock. But, a process can't be waiting for more than on

Re: adding wait_start column to pg_locks

2021-01-13 Thread Ian Lawrence Barwick
Hi 2021年1月4日(月) 15:04 torikoshia : > > On 2021-01-02 06:49, Justin Pryzby wrote: > > On Tue, Dec 15, 2020 at 11:47:23AM +0900, torikoshia wrote: > >> So I'm now thinking about adding a new column in pg_locks which > >> keeps the time at which locks started waiting. > >> > >> Attached a patch. > >

Re: adding wait_start column to pg_locks

2021-01-03 Thread torikoshia
On 2021-01-02 06:49, Justin Pryzby wrote: On Tue, Dec 15, 2020 at 11:47:23AM +0900, torikoshia wrote: So I'm now thinking about adding a new column in pg_locks which keeps the time at which locks started waiting. Attached a patch. This is failing make check-world, would you send an updated pa

Re: adding wait_start column to pg_locks

2021-01-01 Thread Justin Pryzby
On Tue, Dec 15, 2020 at 11:47:23AM +0900, torikoshia wrote: > So I'm now thinking about adding a new column in pg_locks which > keeps the time at which locks started waiting. > > Attached a patch. This is failing make check-world, would you send an updated patch ? I added you as an author so it