Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eyzbm-0005C6-SN for pgsql-admin@arkaria.postgresql.org; Thu, 22 Mar 2018 12:46:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eyzbl-00042c-H5 for pgsql-admin@arkaria.postgresql.org; Thu, 22 Mar 2018 12:46:17 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eyzbl-00042R-45 for pgsql-admin@lists.postgresql.org; Thu, 22 Mar 2018 12:46:17 +0000 Received: from mail-yb0-x233.google.com ([2607:f8b0:4002:c09::233]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eyzbe-0003gE-4A for pgsql-admin@postgresql.org; Thu, 22 Mar 2018 12:46:15 +0000 Received: by mail-yb0-x233.google.com with SMTP id v66-v6so2867020ybv.2 for ; Thu, 22 Mar 2018 05:46:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=HNDOYS3cII+VDhsd/wkDBrx4oeXmM/feWgFTY2ktEQU=; b=Sc5s49RPdVUnc7grYKMxr9t0KYiQWq3VB/Xeei0KDpYFMM9aQQBKX16dJh+dhNN9VA k2+SJlXhmLiMq8kD+x+Pb1BCvC8VLf6JJncO5Zl3jXF6T+sIYVko4XQ4TPCIajkVLeMx RwPayxdJ1xMQa3OTJ6ciusMYqwuKG+XA5IOXqvY3iX/ySHAsJ/mPZjXZgavtrxed8Ltr AK9srPEfh6j2WY4io36zbO2zcOCsKJArF3pB2c5adm1xR8cVrkhAEve5pPTyRkXhAOgY Gx7caioRvwFxP4oowq+HxgJAdsLEvvg818n6h7xjHH3soawf3XYU58zM4THNmCbHiYuJ Jz3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=HNDOYS3cII+VDhsd/wkDBrx4oeXmM/feWgFTY2ktEQU=; b=XPU7X8gX/t58O639NG1TpTi+Qs026kkPnNauBpoQ6AzIpPnCdjf/OluRZSxapBqLd/ /TBbpz4ruZ/hVYPtTMsLS2Hii95+dOIaFxeQDqwm+X8J+1nnpDuMbAOd9bqozi2I2s/w YPsq93eFaORbXdc6AfwTQ7zxEFzf4tS31d6slZlx/w4uqNb2Bv0xbRx1naj3szNBEmxi 4ihlXs2A6OMpigAcWvo0ce1wxrpFR6zcV73wq4hLXnXpkdtAWzw3HPnXLzYqzXRZvkm1 MfH/Sj2RrNP1S+5EfrV2yG09hm/oe0aO/opyx4o4rvQ9kuLlPZ5VNZ/W+HDMnvHXY+VW WvEA== X-Gm-Message-State: AElRT7HinH+ADUhXwa60dXqGS4coY7inSWIz/WZeUqRHndNeQ+2vCexq AB9cKQRD9wgb5RsdmjlHRYtSZVSlxxInVnotzTg= X-Google-Smtp-Source: AG47ELsyZZ06xGvDvbrT1xoZxkWVOtGTwIERQoC3GLP2rRFTSKCU3QV0wreZcFHuKgtItcTlSasfpmd9wyKFUa2TIbc= X-Received: by 2002:a25:b9cb:: with SMTP id y11-v6mr8172819ybj.498.1521722768460; Thu, 22 Mar 2018 05:46:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.90.212 with HTTP; Thu, 22 Mar 2018 05:45:38 -0700 (PDT) From: Debraj Manna Date: Thu, 22 Mar 2018 18:15:38 +0530 Message-ID: Subject: pg_stat_activity doubts To: pgsql-admin Content-Type: multipart/alternative; boundary="0000000000000f90120567ffb159" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --0000000000000f90120567ffb159 Content-Type: text/plain; charset="UTF-8" Hi Can someone resolve my below doubts about pg_stat_activity :- 1. Can someone let me know how pg_stat_activity is populated? If I am executing a query like `Select * from pg_stat_activity` does it produce the details from some snapshot maintained by postgres or it checks the current connections open in postgres to provide the details? 2. Can some let me know what does the state IDLE denotes in the row of pg_stat_activity? Is it like it checks all the open connections to postgres and if the connection is not executing any query then IDLE denotes the last query executed by the connection? 3. In the output of select * from pg_stat_activity I am seeing rows with state IDLE and the query_start_date more than 2 days old? What does this signify ? Should I be worried about this? 4. --0000000000000f90120567ffb159 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

Can someone resolve my below doubts = about pg_stat_activity :-
<= div>
  1. Can someone let me know how pg_stat_activity is populated? If I am executing a q= uery like `Select * from pg_stat_activi= ty` does it produce the details from some snapshot maintained by pos= tgres or it checks the current connections open in postgres to provide the = details?
  2. Can some let me know what does the state IDLE denotes in the row of pg_stat_activity? Is it like it checks all the open co= nnections to postgres and if the connection is not executing any query then= IDLE denotes the last query executed by the connection?
  3. In the out= put of select * from pg_stat_activity I am seeing rows with state IDLE<= /font> and the query_start_date = more than 2 days old? What does this signify ? Should I be worried about th= is?
  4. =C2=A0


--0000000000000f90120567ffb159--