Re: We find few queries running three times simultaneously with sameparameters on postgres db
От | Melvin Davidson |
---|---|
Тема | Re: We find few queries running three times simultaneously with sameparameters on postgres db |
Дата | |
Msg-id | CANu8Fix+vTN46zgSAFhu7=F06L+=ok2S=eToQmqnLN6PoZa3Lg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: We find few queries running three times simultaneously with sameparameters on postgres db (amandeep singh <singh_a@live.in>) |
Список | pgsql-general |
On Tue, Jun 26, 2018 at 1:26 PM, amandeep singh <singh_a@live.in> wrote:
Hi AndreasThe value for $1 is same in all queries.@Edson: number of such running queries are always 3.From: Andreas KretschmerSent: Tuesday, 26 June, 6:04 PMSubject: Re: We find few queries running three times simultaneously with same parameters on postgres dbOn 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;
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!
Maj. Database & Exploration Specialist
Universe Exploration Command – UXC
Employment by invitation only!
В списке pgsql-general по дате отправления: