RE: minimizing pg_stat_statements performance overhead
От | Raymond Martin |
---|---|
Тема | RE: minimizing pg_stat_statements performance overhead |
Дата | |
Msg-id | BN8PR21MB1217D3F1BAF98ECB9795CC9FB1500@BN8PR21MB1217.namprd21.prod.outlook.com обсуждение исходный текст |
Ответ на | Re: minimizing pg_stat_statements performance overhead (legrand legrand <legrand_legrand@hotmail.com>) |
Ответы |
RE: minimizing pg_stat_statements performance overhead
|
Список | pgsql-hackers |
From: Robert Haas >> >> One thing that needs some thought here is what happens if the value of >> pgss_enabled() changes. For example we don't want a situation where >> if the value changes from off to on between one stage of processing >> and another, the server crashes. >> >> I don't know whether that's a risk here or not; it's just something to >> think about. This is definitely an important consideration for this change. A hook could have the implicit assumption that a query ID is always generated. From: PAscal > Hi, here is a simple test where I commented that line in pgss_post_parse_analyze > to force return; (as if pgss_enabled() was disabled) but kept pgss_enabled() every where else > > /* Safety check... */ > // if (!pgss || !pgss_hash || !pgss_enabled()) > return; > > This works without crash as you can see here after: In theory, the rest of the hooks look solid. As mentioned above, I think the major concern would be a hook that depends on a variable generated in pgss_post_parse_analyze. Two hooks (pgss_ExecutorStart, pgss_ExecutorEnd) depend on the query ID generated from pgss_post_parse_analyze. Fortunately, both of these functions already check for query ID before doing work. I really appreciate you putting this change into practice. Great to see your results align with mine. Thanks Pascal!!! -- Raymond Martin ramarti@microsoft.com Azure Database for PostgreSQL
В списке pgsql-hackers по дате отправления: