Re: [HACKERS] Lazy hash table for XidInMVCCSnapshot (helps Zipfian a bit)

2018-11-30 Thread Dmitry Dolgov
>On Sun, Nov 4, 2018 at 1:27 PM Dmitry Dolgov <9erthali...@gmail.com> wrote: > > > On Sun, 1 Apr 2018 at 19:58, Yura Sokolov wrote: > > > > I didn't change serialized format. Therefore is no need to change > > SerializeSnapshot. > > But in-memory representation were changed, so RestoreSnapshot is

Re: [HACKERS] Lazy hash table for XidInMVCCSnapshot (helps Zipfian a bit)

2018-11-04 Thread Dmitry Dolgov
> On Sun, 1 Apr 2018 at 19:58, Yura Sokolov wrote: > > I didn't change serialized format. Therefore is no need to change > SerializeSnapshot. > But in-memory representation were changed, so RestoreSnapshot is changed. This patch went through the last tree commit fests without any noticeable

Re: [HACKERS] Lazy hash table for XidInMVCCSnapshot (helps Zipfian a bit)

2018-04-01 Thread Yura Sokolov
23.03.2018 17:59, Amit Kapila пишет: > On Sat, Mar 10, 2018 at 7:41 AM, Yura Sokolov wrote: >> 08.03.2018 03:42, Tomas Vondra пишет: >>> One reason against building the hash table in GetSnapshotData is that >>> we'd build it even when the snapshot is never queried. Or when

Re: [HACKERS] Lazy hash table for XidInMVCCSnapshot (helps Zipfian a bit)

2018-04-01 Thread Yura Sokolov
17.03.2018 03:36, Tomas Vondra пишет: > > On 03/17/2018 12:03 AM, Yura Sokolov wrote: >> 16.03.2018 04:23, Tomas Vondra пишет: >>> >>> ... >>> >>> OK, a few more comments. >>> >>> 1) The code in ExtendXipSizeForHash seems somewhat redundant with >>> my_log2 (that is, we could just call the

Re: [HACKERS] Lazy hash table for XidInMVCCSnapshot (helps Zipfian a bit)

2018-03-16 Thread Tomas Vondra
On 03/17/2018 12:03 AM, Yura Sokolov wrote: > 16.03.2018 04:23, Tomas Vondra пишет: >> >> ... >> >> OK, a few more comments. >> >> 1) The code in ExtendXipSizeForHash seems somewhat redundant with >> my_log2 (that is, we could just call the existing function). > > Yes, I could call my_log2 from

Re: [HACKERS] Lazy hash table for XidInMVCCSnapshot (helps Zipfian a bit)

2018-03-16 Thread Yura Sokolov
16.03.2018 04:23, Tomas Vondra пишет: > > > On 03/10/2018 03:11 AM, Yura Sokolov wrote: >> 08.03.2018 03:42, Tomas Vondra пишет: >>> On 03/06/2018 06:23 AM, Yura Sokolov wrote: 05.03.2018 18:00, Tom Lane пишет: > Tomas Vondra writes: >> Snapshots are

Re: [HACKERS] Lazy hash table for XidInMVCCSnapshot (helps Zipfian a bit)

2018-03-15 Thread Tomas Vondra
On 03/10/2018 03:11 AM, Yura Sokolov wrote: > 08.03.2018 03:42, Tomas Vondra пишет: >> On 03/06/2018 06:23 AM, Yura Sokolov wrote: >>> 05.03.2018 18:00, Tom Lane пишет: Tomas Vondra writes: > Snapshots are static (we don't really add new XIDs into existing

Re: [HACKERS] Lazy hash table for XidInMVCCSnapshot (helps Zipfian a bit)

2018-03-09 Thread Yura Sokolov
08.03.2018 03:42, Tomas Vondra пишет: > On 03/06/2018 06:23 AM, Yura Sokolov wrote: >> 05.03.2018 18:00, Tom Lane пишет: >>> Tomas Vondra writes: Snapshots are static (we don't really add new XIDs into existing ones, right?), so why don't we simply sort the

Re: [HACKERS] Lazy hash table for XidInMVCCSnapshot (helps Zipfian a bit)

2018-03-05 Thread Yura Sokolov
05.03.2018 18:00, Tom Lane пишет: > Tomas Vondra writes: >> Snapshots are static (we don't really add new XIDs into existing ones, >> right?), so why don't we simply sort the XIDs and then use bsearch to >> lookup values? That should fix the linear search, without

Re: [HACKERS] Lazy hash table for XidInMVCCSnapshot (helps Zipfian a bit)

2018-03-05 Thread Tom Lane
Tomas Vondra writes: > Snapshots are static (we don't really add new XIDs into existing ones, > right?), so why don't we simply sort the XIDs and then use bsearch to > lookup values? That should fix the linear search, without need for any > local hash table. +1 for

Re: [HACKERS] Lazy hash table for XidInMVCCSnapshot (helps Zipfian a bit)

2018-03-05 Thread Tomas Vondra
Hi, I've done a bit of benchmarking on the last patch version (from 22/8), using a simple workload: 1) 8 clients doing SELECT SUM(abalance) FROM pgbench_accounts with the table truncated to only 10k rows 2) variable number (8, 16, 32, ..., 512) of write clients, doing this \set aid

Re: [HACKERS] Lazy hash table for XidInMVCCSnapshot (helps Zipfian a bit)

2018-01-22 Thread Stephen Frost
Greetings, * Sokolov Yura (funny.fal...@postgrespro.ru) wrote: > diff --git a/src/backend/utils/time/snapmgr.c > b/src/backend/utils/time/snapmgr.c > index 08a08c8e8f..7c3fe7563e 100644 > --- a/src/backend/utils/time/snapmgr.c > +++ b/src/backend/utils/time/snapmgr.c > @@ -662,13 +662,16 @@

Re: [HACKERS] Lazy hash table for XidInMVCCSnapshot (helps Zipfian a bit)

2017-11-29 Thread Michael Paquier
On Tue, Aug 22, 2017 at 9:17 PM, Sokolov Yura wrote: > Simplified a bit and more commented patch version is in attach. > > Algorithm were switched to linear probing, it makes code simpler and > clearer. > Flag usages were toggled: now it indicates that hash table were