Strange code in EXPLAIN for queryid - Mailing list pgsql-hackers

From David Rowley
Subject Strange code in EXPLAIN for queryid
Date
Msg-id CAApHDvqhSLYpSU_EqUdN39w9Uvb8ogmHV7_3YhJ0S3aScGBjsg@mail.gmail.com
Whole thread Raw
Responses Re: Strange code in EXPLAIN for queryid  (Julien Rouhaud <rjuju123@gmail.com>)
List pgsql-hackers
I was wondering about the following code in explain.c

char buf[MAXINT8LEN + 1];

pg_lltoa(plannedstmt->queryId, buf);
ExplainPropertyText("Query Identifier", buf, es);

I thought it was a bit strange that we don't just use
ExplainPropertyInteger() instead of going to the trouble of building
the string with pg_lltoa().

On looking a little closer I also saw that plannedstmt->queryId is a
uint64.  I guess that we're showing this as an int64 so that it
matches the queryid column in the pg_stat_statements view? If so, I
think it's worth a comment to mention why we're not using
ExplainPropertyUInteger.

Any objection to applying the attached to pg14 and master?

David

Attachment

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Extra code in commit_ts.h
Next
From: Tomas Vondra
Date:
Subject: Re: Use generation context to speed up tuplesorts