forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit566a1d4
committed
Improve contrib/pg_stat_statements' handling of PREPARE/EXECUTE statements.
It's actually more useful for the module to ignore these. IgnoringEXECUTE (and not incrementing the nesting level) allows the executorhooks to charge the time to the underlying prepared query, whichshows up as a stats entry with the original PREPARE as query string(possibly modified by suppression of constants, which might not beterribly useful here but it's not worth avoiding). This is much moreuseful than cluttering the stats table with a distinct entry for eachtextually distinct EXECUTE.Experimentation with this idea shows that it's also preferable to ignorePREPARE. If we don't, we get two stats table entries, one with the querystring hash and one with the jumble-derived hash, but with the same visiblequery string (modulo those constants). This is confusing and not veryhelpful, since the first entry will only receive costs associated withinitial planning of the query, which is not something counted at allnormally by pg_stat_statements. (And if we do start tracking planningcosts, we'd want them blamed on the other hash table entry anyway.)1 parente0e4ebe commit566a1d4
1 file changed
+17
-2
lines changedLines changed: 17 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
174 | 174 |
| |
175 | 175 |
| |
176 | 176 |
| |
177 |
| - | |
| 177 | + | |
178 | 178 |
| |
179 | 179 |
| |
180 | 180 |
| |
| |||
773 | 773 |
| |
774 | 774 |
| |
775 | 775 |
| |
776 |
| - | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
777 | 792 |
| |
778 | 793 |
| |
779 | 794 |
| |
|
0 commit comments
Comments
(0)