aboutsummaryrefslogtreecommitdiff
path: root/src/tutorial/basics.source
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2024-04-06 20:51:07 -0700
committerAndres Freund <andres@anarazel.de>2024-04-06 23:52:26 -0700
commita97bbe1f1df9eba0b18207c321c67de80b33db16 (patch)
treeecbb90f1c3806fbe004e7b29003777986373d4e6 /src/tutorial/basics.source
parent41c51f0c68b21b4603bd2a9c3d3ad017fdd22627 (diff)
downloadpostgresql-a97bbe1f1df9eba0b18207c321c67de80b33db16.tar.gz
postgresql-a97bbe1f1df9eba0b18207c321c67de80b33db16.zip
Reduce branches in heapgetpage()'s per-tuple loop
Until now, heapgetpage()'s loop over all tuples performed some conditional checks for each tuple, even though condition did not change across the loop. This commit fixes that by moving the loop into an inline function. By calling it with different constant arguments, the compiler can generate an optimized loop for the different conditions, at the price of two per-page checks. For cases of all-visible tables and an isolation level other than serializable, speedups of up to 25% have been measured. Reviewed-by: John Naylor <johncnaylorls@gmail.com> Reviewed-by: Zhang Mingli <zmlpostgres@gmail.com> Tested-by: Quan Zongliang <quanzongliang@yeah.net> Discussion: https://postgr.es/m/20230716015656.xjvemfbp5fysjiea@awork3.anarazel.de Discussion: https://postgr.es/m/2ef7ff1b-3d18-2283-61b1-bbd25fc6c7ce@yeah.net
Diffstat (limited to 'src/tutorial/basics.source')
0 files changed, 0 insertions, 0 deletions