Understand time taken by individual SQL statements in a procedure

2023-06-03 Thread Satalabaha Postgres
Hi Listers, We would like to determine how long it takes for each SQL statement to execute within a long-running procedure. I tried to see if pg_stat_statements could offer any insight into the matter. But I was unable to locate any. Is this even possible? How can we also determine the precise SQ

Re: Understand time taken by individual SQL statements in a procedure

2023-06-03 Thread Satalabaha Postgres
Thanks Julien. Regards, Satalabha On Sat, 3 Jun 2023 at 13:06, Julien Rouhaud wrote: > Hi, > > On Sat, Jun 03, 2023 at 12:48:37PM +0530, Satalabaha Postgres wrote: > > Hi Listers, > > > > We would like to determine how long it takes for each SQL statement to > &

Weird behavior of INSERT QUERY

2023-06-04 Thread Satalabaha Postgres
Hi Listers, DB : postgres 14. We are experiencing weird performance issue of one simple insert statement taking several minutes to insert data. The application calls insert statement via stored procedure show mentioned below. The select query in the insert returns about 499 rows. However, this i

Re: Weird behavior of INSERT QUERY

2023-06-04 Thread Satalabaha Postgres
; OPERATOR(pg_catalog.=) $1 FOR KEY SHARE OF x" Regards, Satalabha On Sun, 4 Jun 2023 at 14:04, Satalabaha Postgres < satalabaha.postg...@gmail.com> wrote: > Hi Listers, > > DB : postgres 14. > > We are experiencing weird performance issue of one simple insert state

Re: Weird behavior of INSERT QUERY

2023-06-04 Thread Satalabaha Postgres
Hi Julien, Yes both in both the cases the same tables are accessed. Yes we tried indexing as well, but we have the same behaviour. Regards, Satalabha On Sun, 4 Jun 2023 at 16:51, Julien Rouhaud wrote: > Hi, > > On Sun, Jun 04, 2023 at 02:04:52PM +0530, Satalabaha Postgres wrote: &

Re: Weird behavior of INSERT QUERY

2023-06-04 Thread Satalabaha Postgres
On Sun, 4 Jun 2023 at 19:46, Ranier Vilela wrote: > Em dom., 4 de jun. de 2023 às 05:35, Satalabaha Postgres < > satalabaha.postg...@gmail.com> escreveu: > >> Hi Listers, >> >> DB : postgres 14. >> >> We are experiencing weird performance issue of

Re: Weird behavior of INSERT QUERY

2023-06-04 Thread Satalabaha Postgres
Regards, Satalabha On Sun, 4 Jun 2023 at 18:56, Tom Lane wrote: > Satalabaha Postgres writes: > > The select query in the insert returns about 499 rows. However, this > insert > > statement when executed from application user i.e. schema1_u takes close > to > >

Re: Weird behavior of INSERT QUERY

2023-06-05 Thread Satalabaha Postgres
On Mon, 5 Jun 2023 at 04:35, Ranier Vilela wrote: > Em dom., 4 de jun. de 2023 às 11:49, Satalabaha Postgres < > satalabaha.postg...@gmail.com> escreveu: > >> >> >> >> On Sun, 4 Jun 2023 at 19:46, Ranier Vilela wrote: >> >>> Em

query column in pg_stat_statements and pg_stat_activity

2024-06-03 Thread Satalabaha Postgres
I've written the below SQL query that joins pg_stat_statements with pg_stat_activity using "queryid" as the join condition. Yet, the results show that pg_stat_statements and pg_stat_activity are reporting two distinct queries for the identical queryid. Can this occur? select pgss.queryid as "PGSS