* This method releases the hash table's memory. It maintains some of the other * aspects of the hash table like memory usage statistics. These may be required * during an explain analyze. A hash table that has been released cannot perform * any useful function anymore. */
| 1774 | * any useful function anymore. |
| 1775 | */ |
| 1776 | static void |
| 1777 | ReleaseHashTable(HashJoinState *node) |
| 1778 | { |
| 1779 | if (node->hj_HashTable) |
| 1780 | { |
| 1781 | HashState *hashState = (HashState *) innerPlanState(node); |
| 1782 | |
| 1783 | /* This hashtable should not have been released already! */ |
| 1784 | Assert(!node->hj_HashTable->eagerlyReleased); |
| 1785 | if (node->hj_HashTable->stats) |
| 1786 | { |
| 1787 | /* Report on batch in progress. */ |
| 1788 | ExecHashTableExplainBatchEnd(hashState, node->hj_HashTable); |
| 1789 | } |
| 1790 | ExecHashTableDestroy(hashState, node->hj_HashTable); |
| 1791 | node->hj_HashTable->eagerlyReleased = true; |
| 1792 | } |
| 1793 | |
| 1794 | /* Always reset intra-tuple state */ |
| 1795 | node->hj_CurHashValue = 0; |
| 1796 | node->hj_CurBucketNo = 0; |
| 1797 | node->hj_CurTuple = NULL; |
| 1798 | |
| 1799 | node->hj_JoinState = HJ_NEED_NEW_OUTER; |
| 1800 | node->hj_MatchedOuter = false; |
| 1801 | node->hj_FirstOuterTupleSlot = NULL; |
| 1802 | |
| 1803 | } |
| 1804 | |
| 1805 | #ifdef USE_ASSERT_CHECKING |
| 1806 | /* Is this an IS-NOT-DISTINCT-join qual list (as opposed the an equijoin)? |
no test coverage detected