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 1hqOXr-0003nR-8G for pgsql-general@arkaria.postgresql.org; Wed, 24 Jul 2019 21:11:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hqOXn-0003cW-FQ for pgsql-general@arkaria.postgresql.org; Wed, 24 Jul 2019 21:11:27 +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 1hqOXm-0003cO-Be for pgsql-general@lists.postgresql.org; Wed, 24 Jul 2019 21:11:27 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1hqOXj-0003vR-3s for pgsql-general@lists.postgresql.org; Wed, 24 Jul 2019 21:11:25 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 184AD20A3C; Wed, 24 Jul 2019 17:11:22 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 24 Jul 2019 17:11:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=q EsqPebN8yLt3DXV/B0EuZP94Wp9XMxTLkhfTb1U5bY=; b=HRRT3SB7aBem8vrUf 1IGozXuGy8BT7SAraYHRzDVgykXJJc94Hk1iSe22I1+vEJLrK0BDR8/UEkPJ6Ibz 6/NAbJP0O4pGot/auxqvC7J5IDhLUrg6Hq+op/5fZX7tvs9tg1HfWkqdkzlBuTIc oduR9e+aSHBWy6aMZZS5ZJ8FSxkzMNerhVIoXsULK4UAxDzG6oFe2yMjkjU2kLCp OoBGDHwzbO/1DBnX73+1vWxlArs8jYfhGS5JlROQJw94WVO3DUKDRKtnNshathhh k/EdMqfbxFwWtpAB01TEpB1bXOS0lnRiFzS06ZRSaV7MB6koa5trnpCG7xeBAxwD F5/8g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=qEsqPebN8yLt3DXV/B0EuZP94Wp9XMxTLkhfTb1U5 bY=; b=wUVMq8HxirqVn4UmQzC5jUH5yxZFNNpBKUcyOPgGKV6iJ5si5VwOJbwPX o9SdVYtYWiFAWfAsqqtHNHCJW5tsXgnz5/baBTbZQYopHXGIp9hiektL2iKnJ3oX 1hzFKUWe39wwA/mcMZXSW2FUYyE4C7YwA3ASZUayLHS2OfZORLNzuM37nv4Azapj wUFkqru4jq4EiWWUXg3aUChMgg+4ou36Ws7sKWxxhhcRzl8e/KbEMXTR3rPa7IUa MYxa7/l6CZIRmt2bWRbGQgjSDOwoFSvbZwS0bUqV7ACJNJvv4hIUrPW1/cUMJojk K0ctiU82D5+k3q1r+5zRAxe04FGxg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrkedtgdduheegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucfkphepjeegrdelfedruddthedrudekieenucfrrghrrghmpehmrghilhhfrhho mheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhenucevlhhushhtvg hrufhiiigvpedt X-ME-Proxy: Received: from ranger.suse (74-93-105-186-washington.hfc.comcastbusiness.net [74.93.105.186]) by mail.messagingengine.com (Postfix) with ESMTPA id D1996380083; Wed, 24 Jul 2019 17:11:20 -0400 (EDT) Subject: Re: Running concurrent txns and measuring the timings in Postgres To: Souvik Bhattacherjee Cc: Rob Sargent , "pgsql-generallists.postgresql.org" References: <160cb824-6952-d468-9a6b-3b7474348d5a@aklaver.com> From: Adrian Klaver Message-ID: <77a9686c-4d6d-e964-019f-1966224ae803@aklaver.com> Date: Wed, 24 Jul 2019 14:11:20 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 7/24/19 1:52 PM, Souvik Bhattacherjee wrote: > >Well it depends on the part you have not filled in, what client(s) you > > are using and how the transactions are being generated? > > Using a psql client and txns are generated manually at this point. Each > txn is > stored separately in a .sql file and are fired from different psql > sessions, if that > helps. > A quick demo: psql -d production -U postgres -c "\timing" -c "select line_id, category from avail_headers order by line_id;" Timing is on. Time: 0.710 ms > On Wed, Jul 24, 2019 at 4:44 PM Adrian Klaver > wrote: > > On 7/24/19 1:42 PM, Souvik Bhattacherjee wrote: > >  > The duplicate elimination is being handled by ON CONFLICT or > some custom > >  > process in the code generating the transactions? > > > > Yes, we used ON CONFLICT for that. Thanks btw. > > > >  > If the transactions are being created from a single app/script > could you > >  > not just use 'timing' to mark the beginning of the > transactions and the > >  > end and record that somewhere(db table and/or file)? > > > > So did you mean to say that I need to get the timestamps of the > > beginning/end > > of the txn since \timing only produces elapsed time?  Surely that > would > > solve the > > problem but I'm not sure how to get that done in Postgres. > > > > I wanted to check to see if there are simpler ways to get this > done in > > Postgres > > before trying out something similar to Rob's suggestion or yours. > > > > Well it depends on the part you have not filled in, what client(s) you > are using and how the transactions are being generated? > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > -- Adrian Klaver adrian.klaver@aklaver.com