Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

latest_query_id auto increment caused pg_stat_statements inflate #245

Open
hslightdb opened this issue Feb 8, 2022 · 1 comment
Open

Comments

@hslightdb
Copy link

the following code
/*

  • HACK: We have to mark each Query with a unique
  • id in order to recognize them properly.
    */
    #define QUERY_ID_INITIAL 0
    static uint64 latest_query_id = QUERY_ID_INITIAL;

void
assign_query_id(Query *query)
{
uint64 prev_id = latest_query_id++;

if (prev_id > latest_query_id)
	elog(WARNING, "assign_query_id(): queryId overflow");

query->queryId = latest_query_id;

}
cause queryId changed every request, so pg_stat_statements cannot agg by queryId, finally it's inflate. but we don't find any where that use queryId in pg_pathman.

We have to mark each Query with a unique

  • id in order to recognize them properly
    so can you help to explain what is the purpose and which place use it?
@hslightdb
Copy link
Author

what if we remove assign_query_id() call?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant