Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1km6cy-00058U-Uk for pgsql-admin@arkaria.postgresql.org; Mon, 07 Dec 2020 02:51:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1km6cx-0006Ty-TH for pgsql-admin@arkaria.postgresql.org; Mon, 07 Dec 2020 02:51:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1km6cx-0006Tq-LZ for pgsql-admin@lists.postgresql.org; Mon, 07 Dec 2020 02:51:51 +0000 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1km6cv-0000ZF-Kq for pgsql-admin@lists.postgresql.org; Mon, 07 Dec 2020 02:51:51 +0000 Received: by mail-oi1-x235.google.com with SMTP id t205so13833982oib.12 for ; Sun, 06 Dec 2020 18:51:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=kK/u4peGM+NJu1Rpgx1zp5DSE2jAyZanHv2Fw1Es3po=; b=Lehf5YDGVk5jxVtAraWuPaI+hMnQoT5zzj0qX+JDcCkacrpAqI/WZHOlv8KShEPk2S 5EowRfmZjF+dPqaMyCvJNfI2IlDsQDv7STygOsSoTZMek4WDqLX6cMkJaDisnM82vsS/ oP/w2P24ciWbdcsh2mC+9v8F+MtjzYPl0PSbuRTy0/i9ue2Dn9LFrKMOFyV8X/vI/ENI iUvKYDI6pqTS6ZEbP3aVsgf0+b9gKJh2l1adJzYh0pAW/4/c3aYoXyvqrnE1EgPg9NG4 y2FSA+lpsFEiLxs39JBQ6zM3VbzeYE26vTSzCC8nkf6cDoW+ELz9PDIETKy/p+9A6TZj aIww== 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:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=kK/u4peGM+NJu1Rpgx1zp5DSE2jAyZanHv2Fw1Es3po=; b=BtPAXOM7sMdDQoIKPVU1sOc8BIAdUK0LOOEeBwCCp7uHJALqK6eqspGzUSFjBh124d dNH3S0j65eZja+uzdJ6z2xyzmBZjaCHB5Xiw2YiwPWQRSLPOGrAXpLM+RZI+Z3hRsgJl DVHFHZOODwoF609iyDBLFxL9jCsYSs3MEslSs/HusgZ4S9ZFrg/DAqftJkJW9RUbz/bO FCRrxPpA9UCsfPlpJQpjwWWmK1qgdbtgYatBfYtEu6y7nqFbCaiZf8E5b/PwNGaYOwV3 xZxqd0DemTe6d4lGYOC6pDevLKmDAkmucTkkdYa2s4+rN0042j3qObEaBCsSG17YrKN8 f6sA== X-Gm-Message-State: AOAM531Rttup9Zbq4HTHBdGrahlNWGgMEeznolJoTuUpzm6Bh2VmWBHw NjN9S4ACOJFW/i7hcpFDqQlmFNrA3WkpcA== X-Google-Smtp-Source: ABdhPJzUYndrUSC6wCRJtpvuCrxf1vcnX+FiUyG4VK4rDZkzpXQPt1IGUt01FwAQahYgtOBjjFf2kg== X-Received: by 2002:aca:4006:: with SMTP id n6mr4356736oia.22.1607309507750; Sun, 06 Dec 2020 18:51:47 -0800 (PST) Received: from [192.168.1.10] (ip174-67-141-204.no.no.cox.net. [174.67.141.204]) by smtp.googlemail.com with ESMTPSA id 60sm1130754otn.35.2020.12.06.18.51.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 06 Dec 2020 18:51:47 -0800 (PST) Subject: Re: idle transactions vs memory To: pgsql-admin@lists.postgresql.org References: From: Ron Message-ID: <5c110bc3-54c5-ede2-6aea-58b2bd5e7565@gmail.com> Date: Sun, 6 Dec 2020 20:51:46 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 12/6/20 8:29 PM, Atul Kumar wrote: > Hi, > > I have a basic query that do idle transactions (idle more than 5 > minutes) occupy system memory (RAM) or CPU usage ? > > > Please help me. Whether or not they occupy RAM or use CPU, idle transactions violate one of the fundamental rules of database programming: keep transactions short! -- Angular momentum makes the world go 'round.