public inbox for [email protected]help / color / mirror / Atom feed
Re: Insert query performance 3+ messages / 2 participants [nested] [flat]
* Re: Insert query performance @ 2024-08-19 07:55 Muhammad Ikram <[email protected]> 0 siblings, 1 reply; 3+ messages in thread From: Muhammad Ikram @ 2024-08-19 07:55 UTC (permalink / raw) To: sud <[email protected]>; +Cc: pgsql-general <[email protected]> Hi Sud, Please make following change in your postgresql.conf file log_statement = 'all' Regards, Ikram On Mon, Aug 19, 2024 at 12:48 PM sud <[email protected]> wrote: > Hello All, > > In a version 15.4 postgres database, Is it possible that , if we have two > big range partition tables with foreign key relationships between them, > insert into the child table can cause slowness if we don't have foreign key > index present in the child table? Basically it need to make sure the new > row already added to parent partition table or not. > > > And if there is any possible way(example query tracing etc) to get the > underlying system queries which gets triggered as part of the main insert > query? For example in above scenario, postgres must be executing some query > to check if the incoming row to the child table already exists in the > parent table or not? > > > Regards > > Sud > -- Muhammad Ikram ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Insert query performance @ 2024-08-20 07:19 sud <[email protected]> parent: Muhammad Ikram <[email protected]> 0 siblings, 1 reply; 3+ messages in thread From: sud @ 2024-08-20 07:19 UTC (permalink / raw) To: Muhammad Ikram <[email protected]>; +Cc: pgsql-general <[email protected]> On Mon, Aug 19, 2024 at 1:25 PM Muhammad Ikram <[email protected]> wrote: > Hi Sud, > > Please make following change in your postgresql.conf file > > log_statement = 'all' > > Will this put all the internal sql query or the recursive query entries in the pg_stats_statement view which we can analyze then? And also to debug issues in the production will it be a good idea to set it for a few times and then turn it off or it can have significant performance overhead. ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Insert query performance @ 2024-08-20 10:59 Muhammad Ikram <[email protected]> parent: sud <[email protected]> 0 siblings, 0 replies; 3+ messages in thread From: Muhammad Ikram @ 2024-08-20 10:59 UTC (permalink / raw) To: sud <[email protected]>; +Cc: pgsql-general <[email protected]> It will record all statements in logs. If you are concerned about query times then you may use pg_stat_statements. Muhammad Ikram On Tue, 20 Aug 2024 at 12:19, sud <[email protected]> wrote: > > On Mon, Aug 19, 2024 at 1:25 PM Muhammad Ikram <[email protected]> wrote: > >> Hi Sud, >> >> Please make following change in your postgresql.conf file >> >> log_statement = 'all' >> >> > Will this put all the internal sql query or the recursive query entries in > the pg_stats_statement view which we can analyze then? And also to debug > issues in the production will it be a good idea to set it for a few times > and then turn it off or it can have significant performance overhead. > ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2024-08-20 10:59 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2024-08-19 07:55 Re: Insert query performance Muhammad Ikram <[email protected]> 2024-08-20 07:19 ` sud <[email protected]> 2024-08-20 10:59 ` Muhammad Ikram <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox