Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iMxrS-0003Xa-9C for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Oct 2019 17:22:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iMxrP-0001qE-N2 for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Oct 2019 17:22:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iMxrP-0001pj-Ak for pgsql-hackers@lists.postgresql.org; Tue, 22 Oct 2019 17:22:19 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iMxrM-0000Ob-BK for pgsql-hackers@postgresql.org; Tue, 22 Oct 2019 17:22:18 +0000 Received: by mail-wm1-x344.google.com with SMTP id v3so4448058wmh.1 for ; Tue, 22 Oct 2019 10:22:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=iaDmC54Wr6VD6RH4XjhlBhj+09R0fxDrgRI2FB7Z2Ns=; b=T2YTTXGWSPR5al+h9BktGc01HsFJItDZ3rmdHVpZsGENJaSgM6H1FgJ+Uzu5utk8PN pVFOlds0WIEKJeL1i7gyg51VcSgnHcS0blBoEDrT6Yjn6Bbnncf7hLMKY2PqNVg1vPOm qaM5gp8dR08zJ8097prIy0uau3JW1ZKUhXB/QcBZboUFo8ayL8t96GHsmrYvfgw1wC5w kweNm9CkIsxtOBYYK5Jnu/RVr9DMk3MUPZ4QHcHXeQDjglirWvPzahjBabiLEN66/sM2 7Rvbmi7pQtpwXw+gwZIzpW7cNXuTDy8k562kcPgIAefiOYgFEgpOSoy2kjuFIM8ohKd5 91Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=iaDmC54Wr6VD6RH4XjhlBhj+09R0fxDrgRI2FB7Z2Ns=; b=CPkVLm7XbUHJlddDaWrjUzT61qc0GhwL79eHDsllshtikAISpqnJ3QrP6u6v1e3Dpv 8guJz4nCId6tneDif6EVdb+Jp3YRqK6CiOSqpZSs7n0vqvA0+yPoV5dl8r4wX4mQT+01 Lrd3yOl6WROa8RBsuouT+nE8GlV+B7ATUkL5nEv2BvMO8SPQHSVFhBMeMQJzEMS7Al4V cxjopr0gFWY8h10jx+qTB0RrgkULwdl9QCuEHnFk4LTCSfZUVPxMg9bwddQzX+p5N1fO vaUJDni1EyGgTmH0n0hFZyOFpI1kKNV3/zD8vdttX6OsK2/295e9/gtcmdT8/o33Q3Ok 5hjw== X-Gm-Message-State: APjAAAUjfECc4v8wYWqYXVgzHzjmU6FLi/4JbxLUeU8V0MyQsyXN7wQw KjX6g4cmU/T9pv/QFGz16EFomw== X-Google-Smtp-Source: APXvYqydnu9j4Ug5tNhR/9VwG132ssx6tANjBYbNwejXuSjQB4i08ehrcyH9G+hK/FEkBq9LH4bMww== X-Received: by 2002:a1c:7c13:: with SMTP id x19mr4013506wmc.80.1571764934253; Tue, 22 Oct 2019 10:22:14 -0700 (PDT) Received: from localhost (static-84-42-175-93.net.upcbroadband.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id 12sm11892735wmk.13.2019.10.22.10.22.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2019 10:22:13 -0700 (PDT) Date: Tue, 22 Oct 2019 19:22:10 +0200 From: Tomas Vondra To: Dilip Kumar Cc: Amit Kapila , a.kondratov@postgrespro.ru, Peter Eisentraut , PostgreSQL Hackers Subject: Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions Message-ID: <20191022172210.26bdiv44vwvunrh3@development> References: <20190928190917.hrpknmq76v3ts3lj@development> <20191001135151.swlspdnkxxnhszhn@development> <20191002223254.wgftz4rzwd2m57gn@development> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Oct 22, 2019 at 11:01:48AM +0530, Dilip Kumar wrote: >On Tue, Oct 22, 2019 at 10:46 AM Amit Kapila wrote: >> >> On Thu, Oct 3, 2019 at 1:18 PM Dilip Kumar wrote: >> > >> > I have attempted to test the performance of (Stream + Spill) vs >> > (Stream + BGW pool) and I can see the similar gain what Alexey had >> > shown[1]. >> > >> > In addition to this, I have rebased the latest patchset [2] without >> > the two-phase logical decoding patch set. >> > >> > Test results: >> > I have repeated the same test as Alexy[1] for 1kk and 1kk data and >> > here is my result >> > Stream + Spill >> > N time on master(sec) Total xact time (sec) >> > 1kk 6 21 >> > 3kk 18 55 >> > >> > Stream + BGW pool >> > N time on master(sec) Total xact time (sec) >> > 1kk 6 13 >> > 3kk 19 35 >> > >> >> I think the test results for the master are missing. >Yeah, That time, I was planning to compare spill vs bgworker. > Also, how about >> running these tests over a network (means master and subscriber are >> not on the same machine)? > >Yeah, we should do that that will show the merit of streaming the >in-progress transactions. > Which I agree it's an interesting feature, I think we need to stop adding more stuff to this patch series - it's already complex enough, so making it even more (unnecessary) stuff is a distraction and will make it harder to get anything committed. Typical "scope creep". I think the current behavior (spill to file) is sufficient for v0 and can be improved later - that's fine. I don't think we need to bother with comparisons to master very much, because while it might be a bit slower in some cases, you can always disable streaming (so if there's a regression for your workload, you can undo that). > In general, yours and Alexy's test results >> show that there is merit by having workers applying such transactions. >> OTOH, as noted above [1], we are also worried about the performance >> of Rollbacks if we follow that approach. I am not sure how much we >> need to worry about Rollabcks if commits are faster, but can we think >> of recording the changes in memory and only write to a file if the >> changes are above a certain threshold? I think that might help saving >> I/O in many cases. I am not very sure if we do that how much >> additional workers can help, but they might still help. I think we >> need to do some tests and experiments to figure out what is the best >> approach? What do you think? >I agree with the point. I think we might need to do some small >changes and test to see what could be the best method to handle the >streamed changes at the subscriber end. > >> >> Tomas, Alexey, do you have any thoughts on this matter? I think it is >> important that we figure out the way to proceed in this patch. >> >> [1] - https://www.postgresql.org/message-id/b25ce80e-f536-78c8-d5c8-a5df3e230785%40postgrespro.ru >> > I think the patch should do the simplest thing possible, i.e. what it does today. Otherwise we'll never get it committed. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services