| 5205 | } |
| 5206 | |
| 5207 | void |
| 5208 | ExecSquelchAgg(AggState *node, bool force) |
| 5209 | { |
| 5210 | /* |
| 5211 | * Sometimes, ExecSquelchAgg() is called, but the node is rescanned anyway. |
| 5212 | * If we destroy the hash table here, then we need to rebuild it later. |
| 5213 | * ExecReScanAgg() will try to reuse the hash table if params is not changing |
| 5214 | * or affect input expressions, it will rescan the existing hash table. |
| 5215 | * Therefore, don't destroy the hash table if reusing hashtable during rescan. |
| 5216 | */ |
| 5217 | |
| 5218 | if (!node->ss.ps.squelched && (!ReuseHashTable(node) || force)) |
| 5219 | { |
| 5220 | ExecEagerFreeAgg(node); |
| 5221 | node->ss.ps.squelched = true; |
| 5222 | } |
| 5223 | |
| 5224 | ExecSquelchNode(outerPlanState(node), force); |
| 5225 | } |
| 5226 | |
| 5227 | bool |
| 5228 | ReuseHashTable(AggState *node) |
no test coverage detected