You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In fact, in pgss_store, the query is written in external query text file, before taking the EXCLUSIVE
lock ...
/* Append new query text to file with only shared lock held */
stored = qtext_store( query, query_len,
&query_offset, &gc_count);
in case of query storm, to prevent this, there should be no action between first hash_search and exclusive lock promotion ... removing this action (forcing usage of the qtext_store reserved for gc cases under exclusive lock ) seems to help a lot for this issue, but should slow other tests cases (with many distincts queries for exemple).
Ideal solution would be to move this part after hash entry creation, outside exclusive lock,
query length and offset being updated with counters (but this is a big change).
The text was updated successfully, but these errors were encountered:
An other solution, would be to move explain text writing in log, into entry_alloc(explain text has to be added as parameter).
This seems the better solution to fix that issue and could be a step towards storing explain plan text in memory.
This appears with
pgbench -c20 -t5 (a kind of query storm ...)
on my MSYS2 (windows 10), but not on linux ...
It also appears in native pg_stat_statements as described here
https://www.postgresql-archive.org/pg-stat-statements-duplicated-external-query-texts-with-MSY2-td6140505.html
In fact, in pgss_store, the query is written in external query text file, before taking the EXCLUSIVE
lock ...
in case of query storm, to prevent this, there should be no action between first hash_search and exclusive lock promotion ...
removing this action (forcing usage of the qtext_store reserved for gc cases under exclusive lock ) seems to help a lot for this issue, but should slow other tests cases (with many distincts queries for exemple).
Ideal solution would be to move this part after hash entry creation, outside exclusive lock,
query length and offset being updated with counters (but this is a big change).
The text was updated successfully, but these errors were encountered: