aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/tqueue.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2025-04-09 12:28:34 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2025-04-09 12:28:34 -0400
commit837cc73af29cd9c63515a6f2a36f54dd703a3a3f (patch)
tree09a4cf2c3025bca940fd3f15419e136f8914da4c /src/backend/executor/tqueue.c
parent5bbc596391aeaf9042536cc25ce71f1e4fce6db8 (diff)
downloadpostgresql-837cc73af29cd9c63515a6f2a36f54dd703a3a3f.tar.gz
postgresql-837cc73af29cd9c63515a6f2a36f54dd703a3a3f.zip
Fix performance issue in deadlock-parallel isolation test.
With debug_discard_caches = 1, the runtime of this test script increased by about a factor of 10 after commit 0dca5d68d. That's causing some of our buildfarm animals to fail with a timeout. The reason for the increased time is that now we are re-planning some intentionally-non-inlineable SQL functions on every execution, where the previous coding held onto the original plans throughout the outer query. The previous behavior was arguably quite buggy, so I don't think 0dca5d68d deserves blame here. But we would like this test script to not take so long. To fix, instead of forcing a "parallel safe" label via a non-inlineable SQL function, apply it directly to the advisory-lock functions by making internal-language aliases for them. A small problem is that the advisory-lock functions return void but this test would really like them to return integer 1. I cheated here by declaring the aliases as returning "int". That's perhaps undue familiarity with the implementation of PG_RETURN_VOID(), but that hasn't changed in twenty years and is unlikely to do so in the next twenty. That gets us an integer 0 result, and then an inline-able wrapper to convert that to an integer 1 allows the rest of the script to remain unchanged. For me, this reduces the runtime with debug_discard_caches = 1 by about 100x, making the test comfortably faster than before instead of slower. Discussion: https://postgr.es/m/136163.1744179562@sss.pgh.pa.us
Diffstat (limited to 'src/backend/executor/tqueue.c')
0 files changed, 0 insertions, 0 deletions