pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Pawan Sharma <pawanpg0963@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: CPU SPIKE
Date: Mon, 21 Oct 2019 08:01:37 +0200
Message-ID: <20191021060137.6uetb242vw44hudo@development> (raw)
In-Reply-To: <CAKqG8NVPpbGOiQbNWdx8Ji5o8RB95-Kiwtz7MAs9MarsjFcsrw@mail.gmail.com>
References: <CAKqG8NVPpbGOiQbNWdx8Ji5o8RB95-Kiwtz7MAs9MarsjFcsrw@mail.gmail.com>

On Mon, Oct 21, 2019 at 10:45:33AM +0530, Pawan Sharma wrote:
>Hi All,
>
>Having real high CPU issue (95-98%), with SELECT statements and select
>queries contains multiple AND operator, is it will cause any CPU Spike..???
>
>apps team is using sub-partition, PG11, CPU:24, Mem: 16GB
>

Any query execution is using CPU, so yes - it can cause a spike in CPU
usage. The question is whether the query plan is efficient, or whether
it's using the CPU unenecessarily. You need to show us EXPLAIN ANALYZE
and perhaps explain why you think it shouldn't use this much CPU.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (4+ messages)  latest in thread

Message-ID: <20191021060137.6uetb242vw44hudo@development>
Permalink:  ../20191021060137.6uetb242vw44hudo@development/
Also on:    postgresql.org/message-id/20191021060137.6uetb242vw44hudo@development

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tomas.vondra@2ndquadrant.com, pawanpg0963@gmail.com
  Subject: Re: CPU SPIKE
  In-Reply-To: <20191021060137.6uetb242vw44hudo@development>
  References: <CAKqG8NVPpbGOiQbNWdx8Ji5o8RB95-Kiwtz7MAs9MarsjFcsrw@mail.gmail.com> <20191021060137.6uetb242vw44hudo@development>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox