Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eC6eD-00038L-Se for pgsql-general@arkaria.postgresql.org; Tue, 07 Nov 2017 16:22:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eC6eD-0003xG-Ar for pgsql-general@arkaria.postgresql.org; Tue, 07 Nov 2017 16:22:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eC6eC-0003w9-6C for pgsql-general@postgresql.org; Tue, 07 Nov 2017 16:22:44 +0000 Received: from mail-pg0-x22b.google.com ([2607:f8b0:400e:c05::22b]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1eC6e8-0007BQ-Sd for pgsql-general@postgresql.org; Tue, 07 Nov 2017 16:22:43 +0000 Received: by mail-pg0-x22b.google.com with SMTP id l24so11412880pgu.11 for ; Tue, 07 Nov 2017 08:22:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=2xPOhq3hy10jE3RmTzh0EL3ZCR0hazhhyNivW3zcZSg=; b=VdfvjzY1GPI76WV4pfeTh1P2onWNTYwR7t+JvRlMnho7lcVWY5M+Z+QFkptutIDnlc sj3Nri5rx7RXZTLtLYjCV2TeQcvrr98iyy5Ghkywka+6Y5lTz+Ep2OQBjVKIPMMF2h/5 m8/sxN3SsE7E70GJUpZZuWtQ+8P8EHUSz/kdR3PaFsKhEOjbPiySPXD767O4RyehOde6 M7f6nrP/5UblWeUbxW+3EycXwA4NelS7CTpVX6jbKryUtvwiporJEcKENN/ZrtvmxMv2 asURaz7pF6vw5IERJWB6YprobhMPPs43SJDMY1Ndk0Fom4zy8ltYyjmG2nDEWJnbSRoD ogog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=2xPOhq3hy10jE3RmTzh0EL3ZCR0hazhhyNivW3zcZSg=; b=Xi6SZh3J5QM3SUXoKAr+cXrJSMlbqjECMpZ/UmbgSXdvYP3bOe9zmMcdMfoaK4I9o4 BURAoTi/3hHBJVuFWoDRyf22aDCAosoU8UMyb8kpd3ZlS1NaqK6dlC2Rye/+9K3n63ZC cnohenPjXusO0kkT2dB/tHjltGHuYkw2hIv6MrlT+k4Net66mtJR5ipBHx494XNV3Xtq uz7Cihxpt3lxAhDr0xKHCxkQnB3LTC9rqxpMm1vZy1GB77+1K76GGrYJ31jVVriJwBmm kC/kHUsX0KFKvYedeZEa+GyX3Q+ZY8+lZ97LnIRczeIh41bpOfSht5cHj2O0AsNDtlZ+ tNYg== X-Gm-Message-State: AMCzsaUveP24A2eeXfikgkM4LqhSpmX5d6Iq6LtyQsVz3IIip5ITYQh7 7oiDtnWtgseUw0eZwQMTc3tJjXWg X-Google-Smtp-Source: ABhQp+SmSRsx4qHmyxwHYHpMQ1ThHn6v9u05DwyAyM7z+0LxEYBalp93m8OWIEqh1e0VcYF1+78MSA== X-Received: by 10.99.111.65 with SMTP id k62mr18784407pgc.56.1510071758176; Tue, 07 Nov 2017 08:22:38 -0800 (PST) Received: from [10.104.134.14] ([155.100.47.6]) by smtp.gmail.com with ESMTPSA id w9sm3941465pfl.19.2017.11.07.08.22.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Nov 2017 08:22:37 -0800 (PST) Subject: Re: idle in transaction, why To: Scott Marlowe References: <4a365db4-8608-65c8-e3dc-23524f881bc3@gmail.com> <16893.1509999467@sss.pgh.pa.us> <6ed9ca9b-fb80-e505-2522-be9b5f63a759@gmail.com> <19493.1510000892@sss.pgh.pa.us> <81aa980b-fb4c-e9b4-fa82-9f14df71a2df@gmail.com> <5d130fce-3f5c-fb0a-4bf0-3163c14fc49a@gmail.com> <19B059B9-E4D6-41CA-AB0A-CBAB58C10EC7@gmail.com> Cc: "pgsql-general@postgresql.org" From: Rob Sargent Message-ID: <306c7695-84d0-e0b4-4755-57d14b6fd8e0@gmail.com> Date: Tue, 7 Nov 2017 09:22:51 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org On 11/07/2017 09:09 AM, Scott Marlowe wrote: > On Tue, Nov 7, 2017 at 7:44 AM, Rob Sargent wrote: >> >>> On Nov 7, 2017, at 12:16 AM, Thomas Kellerer wrote: >>> >>> I would figure values in "minutes" to be more realistic depending on the workload and characteristics of the application. >>> >>> A transaction that has several seconds of "think time" between individual statements doesn't seem that unrealistic. >>> >> I started with the default zero and the save went through perfectly. It takes ten minutes so I’ll have a concurrency issue I imagine. > 10 minutes is long-ish but if it's not run all the time etc it may be > what you're stuck with. Idle in transaction doesn't necessarily mean > concurrency issues, as long as you're not operating on a whole table > other people need to update as well. I guess now's a good time to > profile what your code is doing, what's take the longest, and see if > maybe you can split that big transaction up into bite sized pieces. Short story: The save operation in question is insert only. Done in a single transaction (currently). The last run generated 1.7M new 'segments', each of those grouped into one of 131K segmentsets (so another 1.7M members), those 131K sets recorded as 'outputs'. In production we'll start 22 jobs, one per chromosome (no XY) for each pedigree. We spread those across machines, starting roughly at the same time. Analysis time is measured in days and is pretty much linear with chromosome size (and inversely to processor count) but pretty sure at some point two of those send their payload within minutes of each other. You know they will. Do two sets of writes to same table interfere with each other horribly? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general