1
0
mirror of https://github.com/postgres/postgres.git synced 2026-01-27 21:43:08 +03:00

Change internal plan ID type from uint64 to int64

uint64 was chosen to be consistent with the type used by the query ID,
but the conclusion of a recent discussion for the query ID is that int64
is a better fit as the signed form is shown to the user, for PGSS or
EXPLAIN outputs.

This commit changes the plan ID to use int64, following c3eda50b06
that has done the same for the query ID.

The plan ID is new to v18, introduced in 2a0cd38da5.

Author: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Sami Imseih <samimseih@gmail.com>
Discussion: https://postgr.es/m/aCvzJNwetyEI3Sgo@paquier.xyz
This commit is contained in:
Michael Paquier
2025-05-31 09:40:45 +09:00
parent 706054b11b
commit e050af2868
4 changed files with 11 additions and 11 deletions

View File

@@ -173,7 +173,7 @@ typedef struct PgBackendStatus
int64 st_query_id;
/* plan identifier, optionally computed using planner_hook */
uint64 st_plan_id;
int64 st_plan_id;
} PgBackendStatus;
@@ -322,7 +322,7 @@ extern void pgstat_clear_backend_activity_snapshot(void);
/* Activity reporting functions */
extern void pgstat_report_activity(BackendState state, const char *cmd_str);
extern void pgstat_report_query_id(int64 query_id, bool force);
extern void pgstat_report_plan_id(uint64 plan_id, bool force);
extern void pgstat_report_plan_id(int64 plan_id, bool force);
extern void pgstat_report_tempfile(size_t filesize);
extern void pgstat_report_appname(const char *appname);
extern void pgstat_report_xact_timestamp(TimestampTz tstamp);
@@ -330,7 +330,7 @@ extern const char *pgstat_get_backend_current_activity(int pid, bool checkUser);
extern const char *pgstat_get_crashed_backend_activity(int pid, char *buffer,
int buflen);
extern int64 pgstat_get_my_query_id(void);
extern uint64 pgstat_get_my_plan_id(void);
extern int64 pgstat_get_my_plan_id(void);
extern BackendType pgstat_get_backend_type_by_proc_number(ProcNumber procNumber);