pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How to find the final transformed query in postgresql
3+ messages / 2 participants
[nested] [flat]

* How to find the final transformed query in postgresql
@ 2022-04-18 14:02  Goti <aryan.goti@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Goti @ 2022-04-18 14:02 UTC (permalink / raw)
  To: pgsql-performance

Hi Geeks,

Env: postgres12

I am new to postgres and coming from an Oracle background. Please excuse me
if I am not asking valid questions.

 I would like to know if postgres performs any transformations when it does
the parsing? If yes, is there a way we can get the final transformed query?

Thanks,

Goti

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: How to find the final transformed query in postgresql
@ 2022-04-18 14:13  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Goti <aryan.goti@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2022-04-18 14:13 UTC (permalink / raw)
  To: Goti <aryan.goti@gmail.com>; +Cc: pgsql-performance

Goti <aryan.goti@gmail.com> writes:
>  I would like to know if postgres performs any transformations when it does
> the parsing?

This might be helpful reading:

https://www.postgresql.org/docs/current/overview.html

> If yes, is there a way we can get the final transformed query?

See debug_print_parse and friends [1].  Depending on what you mean by
"final transformed query", you might instead want debug_print_rewritten,
or maybe you want the plan, in which case EXPLAIN is a much friendlier
way to look at it than debug_print_plan.

			regards, tom lane

[1] https://www.postgresql.org/docs/current/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: How to find the final transformed query in postgresql
@ 2022-04-18 14:31  Goti <aryan.goti@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Goti @ 2022-04-18 14:31 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-performance

Thanks a lot Tom.

Thanks,

Goti


On Mon, Apr 18, 2022 at 7:43 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Goti <aryan.goti@gmail.com> writes:
> >  I would like to know if postgres performs any transformations when it
> does
> > the parsing?
>
> This might be helpful reading:
>
> https://www.postgresql.org/docs/current/overview.html
>
> > If yes, is there a way we can get the final transformed query?
>
> See debug_print_parse and friends [1].  Depending on what you mean by
> "final transformed query", you might instead want debug_print_rewritten,
> or maybe you want the plan, in which case EXPLAIN is a much friendlier
> way to look at it than debug_print_plan.
>
>                         regards, tom lane
>
> [1]
> https://www.postgresql.org/docs/current/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT
>

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2022-04-18 14:31 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-04-18 14:02 How to find the final transformed query in postgresql Goti <aryan.goti@gmail.com>
2022-04-18 14:13 ` Tom Lane <tgl@sss.pgh.pa.us>
2022-04-18 14:31   ` Goti <aryan.goti@gmail.com>

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