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 1jKGMR-0002gp-6e for pgsql-admin@arkaria.postgresql.org; Fri, 03 Apr 2020 07:03:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jKGMQ-0003TX-2p for pgsql-admin@arkaria.postgresql.org; Fri, 03 Apr 2020 07:03:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jKGMP-0003TP-Og for pgsql-admin@lists.postgresql.org; Fri, 03 Apr 2020 07:03:25 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jKGMN-0008Sp-AH for pgsql-admin@postgresql.org; Fri, 03 Apr 2020 07:03:24 +0000 Received: by mail-wm1-x336.google.com with SMTP id d202so6511558wmd.1 for ; Fri, 03 Apr 2020 00:03:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=5uNU/pl+u9AwhPQX4QyXhmgDR8ZtsTr3lXUg0ZD8aJE=; b=os/GL+L56UKACsCKWcDjRDKaqx1voVPgeTqTzOnnZslQUiJqmtauyyIvvbQN/GcujX G4i/NIxwtgiw1Il9nvrtj4AT2ZSiBryTO4OAbfaSprzqTrvS536HDWGHBaXkfvPBZCjg rUtIHOskDYDtJsTVn+4GOmQ+aTkbYNr7Jut1RqnppvpnAScdpq88UqATWSAwuuc0SRTA hff1tM/x30QfsyZhuOGdeRYQVq1xw5OOUDBzK3w23vrBg+3LWXlsZZHnUHPF6Bj0JT1n tLtYkvbWHo9GU2DBv7cWKrbkfWYFV3JYosLyJafC5jarpAlyoPp7U+pgoiNYEIubjWrX KRhg== 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; bh=5uNU/pl+u9AwhPQX4QyXhmgDR8ZtsTr3lXUg0ZD8aJE=; b=WnyMT1x/fCZ1v2Ufc43nibdKpQlwWHVOMNOASjVdsEe+YbvMbbMCF0croHAUeTyW1V P0hd0xk5W3njkl3El1Knzoz+xi2NIYeQG7WeLc+TfQqVqKNXqetcy3vUv7YT/tz6x09i PEqUxCYr7w0U5CEMKzQnZiebEvwwQhTHEHz/PlBm0paMKf+7tuPHMPEvwMJCrzZ5ka5T gNCHGb7rwQ9FJUBLhBrAo0qCZGXLuDukdUZHaHXmdxTFTDfcq5eKIFaYgTNulp16Me0a f9nJdbpRem/A1AqXH0z63HgnDDcxVQXmNs8NU+u5AlKX79ThaetRtqTMxgdXLlNVuHYo QnSA== X-Gm-Message-State: AGi0PuZS8J0u4l3t4Rv+b4SKaGhhCuaCpe8qfPSnyoYyGVmt/oabJ+Oi t7/9/VzPhk+fgsPO3DmshLs= X-Google-Smtp-Source: APiQypKYfLaikgkeC8MSssIrNZdoU/SLdxA3Kj68rffUgo2J3NVAdXdH1oG5Le6gt0W722SewoDJ9Q== X-Received: by 2002:a1c:6754:: with SMTP id b81mr5212919wmc.135.1585897400570; Fri, 03 Apr 2020 00:03:20 -0700 (PDT) Received: from nol (82-64-124-11.subs.proxad.net. [82.64.124.11]) by smtp.gmail.com with ESMTPSA id w9sm11016604wrk.18.2020.04.03.00.03.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2020 00:03:19 -0700 (PDT) Date: Fri, 3 Apr 2020 09:03:16 +0200 From: Julien Rouhaud To: Ishan joshi Cc: "pgsql-admin@postgresql.org" Subject: Re: Can we extract CPU usage by table/query level Message-ID: <20200403070316.GA95652@nol> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Apr 03, 2020 at 06:19:56AM +0000, Ishan joshi wrote: > Hi Team, > > I have 2 question regarding the CPU usage and transaction details. > > I have PG11.5 server with pg_stat_statements extension. I check all pg_stat tables but I am not able to extract details of CPU usage and transaction histroy along with its transaction time. > > Question 1 : Can we extract details of CPU utilization by query or table in last 24 hrs? This isn't possible with core postgres, but pg_stat_kcache extension (https://github.com/powa-team/pg_stat_kcache) brings this feature (per-query). > Question 2 : Can we extract transaction details of last 24 hrs on PG server. What level of details do you exactly need?