compute_query_id - Mailing list pgsql-general

From Vijaykumar Jain
Subject compute_query_id
Date
Msg-id CAM+6J945dckHgp7f_nvuOpcOxJLoXsKRtPH6zhFFJZ8f7Ox_ag@mail.gmail.com
Whole thread Raw
Responses Re: compute_query_id  (Julien Rouhaud <rjuju123@gmail.com>)
List pgsql-general
hi,

I noticed this new param compute_query_id in pg14beta.
it is interesting as I was long wanting to identify a query with a unique id like we have for http requests etc so that we can trace the query all the way to shards via FDW etc.

but i cannot see them in the logs even after setting compute_query_id on.
i also read
compute_query_id_query  for the same.
how is the compute_query_id actually calculated? 
why does it show 0 in logs for random sql queries. 
log_line_prefix = '%Q :'
0 :LOG:  statement: select * from pg_stat_activity;

i mean pid already was doing the job to identify the query and its children even it logs,
but i know pid will get recycled.

tldr;
how is compute_query_id different from pid to identify some query running ?
can it be passed on to FDW queries ? for tracing etc ?

am i totally getting its use case totally wrong :) 


--
Thanks,
Vijay
Mumbai, India

pgsql-general by date:

Previous
From: Celia McInnis
Date:
Subject: Treating float arrays as vectors?
Next
From: Julien Rouhaud
Date:
Subject: Re: compute_query_id