From: | Melvin Davidson <melvin6925(at)gmail(dot)com> |
---|---|
To: | amandeep singh <singh_a(at)live(dot)in> |
Cc: | "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>, Andreas Kretschmer <andreas(at)a-kretschmer(dot)de> |
Subject: | Re: We find few queries running three times simultaneously with same parameters on postgres db |
Date: | 2018-06-26 18:13:21 |
Message-ID: | CANu8Fix+vTN46zgSAFhu7=F06L+=ok2S=eToQmqnLN6PoZa3Lg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Tue, Jun 26, 2018 at 1:26 PM, amandeep singh <singh_a(at)live(dot)in> wrote:
> Hi Andreas
>
> The value for $1 is same in all queries.
>
> @Edson: number of such running queries are always 3.
>
> Get Outlook for Android <https://aka.ms/ghei36>
>
>
>
> From: Andreas Kretschmer
> Sent: Tuesday, 26 June, 6:04 PM
> Subject: Re: We find few queries running three times simultaneously with
> same parameters on postgres db
> To: pgsql-general(at)lists(dot)postgresql(dot)org
>
>
> On 26 June 2018 12:32:44 CEST, Andreas Kretschmer wrote: > > >Am
> 26.06.2018 um 12:19 schrieb amandeep singh: >> We have been observing our
> postgres database from past few days,We >> found few queries running three
> times simultaneously with same >> parameters.I would like to back track how
> a query is running multiple > >> times. > >they are independend each other.
> You can run those queries with EXPLAIN > >ANALYSE to see the execution
> plan. > >Regards, Andreas seems like i misunderstud your query. are you
> sure, that the parameter $1 is equal across all different connections?
> Andreas -- 2ndQuadrant - The PostgreSQL Support Company
>
>
This query will show you the pid, client_addr and user that submitted the
queries, in addition to other useful information.
SELECT backend_start as be_start,
datname,
pid as pid,
client_addr,
usename as user,
state,
query,
wait_event_type,
query_start,
current_timestamp - query_start as duration
FROM pg_stat_activity
WHERE pg_backend_pid() <> pid
ORDER BY 1,
datname,
query_start;
--
*Melvin Davidson*
*Maj. Database & Exploration Specialist*
*Universe Exploration Command – UXC*
Employment by invitation only!
From | Date | Subject | |
---|---|---|---|
Next Message | Jerry Sievers | 2018-06-26 20:48:13 | Re: found xmin from before relfrozenxid on pg_catalog.pg_authid |
Previous Message | amandeep singh | 2018-06-26 17:26:14 | Re: We find few queries running three times simultaneously with same parameters on postgres db |