Commit 608fd19
committed
Optimize various aggregate deserialization functions
The serialized representation of an internal aggregate state is a bytea
value. In each deserial function, in order to "receive" the bytea value
we appended it onto a short-lived StringInfoData using
appendBinaryStringInfo. This was a little wasteful as it meant having to
palloc memory, copy a (possibly long) series of bytes then later pfree
that memory. Instead of going to this extra trouble, we can just fake up
a StringInfoData and point the data directly at the bytea's payload. This
should help increase the performance of internal aggregate
deserialization.
Reviewed-by: Michael Paquier
Discussion: https://postgr.es/m/CAApHDvr=e-YOigriSHHm324a40HPqcUhSp6pWWgjz5WwegR=cQ@mail.gmail.com1 parent 7cc2f59 commit 608fd19
3 files changed
+42
-42
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
723 | 723 | | |
724 | 724 | | |
725 | 725 | | |
726 | | - | |
727 | | - | |
| 726 | + | |
| 727 | + | |
728 | 728 | | |
729 | | - | |
730 | | - | |
731 | | - | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
732 | 733 | | |
733 | 734 | | |
734 | 735 | | |
| |||
825 | 826 | | |
826 | 827 | | |
827 | 828 | | |
828 | | - | |
829 | 829 | | |
830 | 830 | | |
831 | 831 | | |
| |||
1134 | 1134 | | |
1135 | 1135 | | |
1136 | 1136 | | |
1137 | | - | |
1138 | | - | |
| 1137 | + | |
| 1138 | + | |
1139 | 1139 | | |
1140 | | - | |
1141 | | - | |
1142 | | - | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
1143 | 1144 | | |
1144 | 1145 | | |
1145 | 1146 | | |
| |||
1197 | 1198 | | |
1198 | 1199 | | |
1199 | 1200 | | |
1200 | | - | |
1201 | 1201 | | |
1202 | 1202 | | |
1203 | 1203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5190 | 5190 | | |
5191 | 5191 | | |
5192 | 5192 | | |
5193 | | - | |
5194 | | - | |
| 5193 | + | |
| 5194 | + | |
5195 | 5195 | | |
5196 | | - | |
5197 | | - | |
5198 | | - | |
| 5196 | + | |
| 5197 | + | |
| 5198 | + | |
| 5199 | + | |
5199 | 5200 | | |
5200 | 5201 | | |
5201 | 5202 | | |
| |||
5222 | 5223 | | |
5223 | 5224 | | |
5224 | 5225 | | |
5225 | | - | |
5226 | 5226 | | |
5227 | 5227 | | |
5228 | 5228 | | |
| |||
5306 | 5306 | | |
5307 | 5307 | | |
5308 | 5308 | | |
5309 | | - | |
5310 | | - | |
| 5309 | + | |
| 5310 | + | |
5311 | 5311 | | |
5312 | | - | |
5313 | | - | |
5314 | | - | |
| 5312 | + | |
| 5313 | + | |
| 5314 | + | |
| 5315 | + | |
5315 | 5316 | | |
5316 | 5317 | | |
5317 | 5318 | | |
| |||
5342 | 5343 | | |
5343 | 5344 | | |
5344 | 5345 | | |
5345 | | - | |
5346 | 5346 | | |
5347 | 5347 | | |
5348 | 5348 | | |
| |||
5677 | 5677 | | |
5678 | 5678 | | |
5679 | 5679 | | |
5680 | | - | |
5681 | | - | |
| 5680 | + | |
| 5681 | + | |
5682 | 5682 | | |
5683 | | - | |
5684 | | - | |
5685 | | - | |
| 5683 | + | |
| 5684 | + | |
| 5685 | + | |
| 5686 | + | |
5686 | 5687 | | |
5687 | 5688 | | |
5688 | 5689 | | |
| |||
5706 | 5707 | | |
5707 | 5708 | | |
5708 | 5709 | | |
5709 | | - | |
5710 | 5710 | | |
5711 | 5711 | | |
5712 | 5712 | | |
| |||
5868 | 5868 | | |
5869 | 5869 | | |
5870 | 5870 | | |
5871 | | - | |
5872 | | - | |
| 5871 | + | |
| 5872 | + | |
5873 | 5873 | | |
5874 | | - | |
5875 | | - | |
5876 | | - | |
| 5874 | + | |
| 5875 | + | |
| 5876 | + | |
| 5877 | + | |
5877 | 5878 | | |
5878 | 5879 | | |
5879 | 5880 | | |
| |||
5889 | 5890 | | |
5890 | 5891 | | |
5891 | 5892 | | |
5892 | | - | |
5893 | 5893 | | |
5894 | 5894 | | |
5895 | 5895 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5289 | 5289 | | |
5290 | 5290 | | |
5291 | 5291 | | |
5292 | | - | |
5293 | | - | |
| 5292 | + | |
| 5293 | + | |
5294 | 5294 | | |
5295 | | - | |
5296 | | - | |
5297 | | - | |
| 5295 | + | |
| 5296 | + | |
| 5297 | + | |
| 5298 | + | |
5298 | 5299 | | |
5299 | 5300 | | |
5300 | 5301 | | |
| |||
5307 | 5308 | | |
5308 | 5309 | | |
5309 | 5310 | | |
5310 | | - | |
5311 | 5311 | | |
5312 | 5312 | | |
5313 | 5313 | | |
| |||
0 commit comments