forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit785f709
committed
Have the planner account for the Memoize cache key memory
The Memoize executor node stores the cache key values along with thetuple(s) which were found in the outer node which match each key value,however, when the planner tried to estimate how many entries could bestored in the cache, it didn't take into account that the cache key mustalso be stored. In many cases, this won't make a large difference as thekey is likely small in comparison to the tuple(s) being stored, however,it's not impossible to craft cases where the key could take more memorythan the tuple(s) stored for it.Here we adjust the planner so it takes into account the estimated amountof memory to store the cache key. Effectively, this change will reducethe estimated cache hit ratio when it's thought that not all items willfit in the cache, thus Memoize will become more expensive in such cases.The executor already takes into account the memory consumed by the cachekey, so here we only need to adjust the planner.Discussion:https://postgr.es/m/CAApHDvqGErGuyBfQvBQrTCHDbzLTqoiW=_G9sOzeFxWEc_7auA@mail.gmail.com1 parent579ee5d commit785f709
1 file changed
+58
-46
lines changedLines changed: 58 additions & 46 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
189 | 189 |
| |
190 | 190 |
| |
191 | 191 |
| |
| 192 | + | |
192 | 193 |
| |
193 | 194 |
| |
194 | 195 |
| |
| |||
2481 | 2482 |
| |
2482 | 2483 |
| |
2483 | 2484 |
| |
| 2485 | + | |
2484 | 2486 |
| |
2485 | 2487 |
| |
2486 | 2488 |
| |
| |||
2504 | 2506 |
| |
2505 | 2507 |
| |
2506 | 2508 |
| |
2507 |
| - | |
2508 |
| - | |
2509 | 2509 |
| |
2510 | 2510 |
| |
2511 | 2511 |
| |
2512 | 2512 |
| |
| 2513 | + | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
2513 | 2517 |
| |
2514 | 2518 |
| |
2515 | 2519 |
| |
| |||
6021 | 6025 |
| |
6022 | 6026 |
| |
6023 | 6027 |
| |
6024 |
| - | |
6025 |
| - | |
6026 |
| - | |
6027 |
| - | |
6028 |
| - | |
6029 |
| - | |
6030 |
| - | |
6031 |
| - | |
6032 |
| - | |
6033 |
| - | |
6034 |
| - | |
6035 |
| - | |
6036 |
| - | |
6037 |
| - | |
6038 |
| - | |
6039 |
| - | |
6040 |
| - | |
6041 |
| - | |
6042 |
| - | |
6043 |
| - | |
6044 |
| - | |
6045 |
| - | |
6046 |
| - | |
6047 |
| - | |
6048 |
| - | |
6049 |
| - | |
6050 |
| - | |
| 6028 | + | |
6051 | 6029 |
| |
6052 |
| - | |
6053 |
| - | |
6054 |
| - | |
6055 |
| - | |
6056 |
| - | |
6057 |
| - | |
6058 |
| - | |
6059 |
| - | |
| 6030 | + | |
| 6031 | + | |
6060 | 6032 |
| |
6061 |
| - | |
6062 |
| - | |
6063 |
| - | |
6064 |
| - | |
6065 | 6033 |
| |
6066 | 6034 |
| |
6067 |
| - | |
6068 |
| - | |
6069 |
| - | |
6070 |
| - | |
6071 |
| - | |
6072 | 6035 |
| |
6073 | 6036 |
| |
6074 | 6037 |
| |
| |||
6081 | 6044 |
| |
6082 | 6045 |
| |
6083 | 6046 |
| |
| 6047 | + | |
| 6048 | + | |
| 6049 | + | |
| 6050 | + | |
| 6051 | + | |
| 6052 | + | |
| 6053 | + | |
| 6054 | + | |
| 6055 | + | |
| 6056 | + | |
| 6057 | + | |
| 6058 | + | |
| 6059 | + | |
| 6060 | + | |
| 6061 | + | |
| 6062 | + | |
| 6063 | + | |
| 6064 | + | |
| 6065 | + | |
| 6066 | + | |
| 6067 | + | |
| 6068 | + | |
| 6069 | + | |
| 6070 | + | |
| 6071 | + | |
| 6072 | + | |
| 6073 | + | |
| 6074 | + | |
| 6075 | + | |
| 6076 | + | |
| 6077 | + | |
| 6078 | + | |
| 6079 | + | |
| 6080 | + | |
| 6081 | + | |
| 6082 | + | |
| 6083 | + | |
| 6084 | + | |
| 6085 | + | |
| 6086 | + | |
| 6087 | + | |
| 6088 | + | |
| 6089 | + | |
| 6090 | + | |
| 6091 | + | |
| 6092 | + | |
| 6093 | + | |
| 6094 | + | |
| 6095 | + | |
6084 | 6096 |
| |
6085 | 6097 |
| |
6086 | 6098 |
| |
|
0 commit comments
Comments
(0)