clean up memory not used in final aggregation (sort, reduce, hll) before aggregation happen
()
| 685 | // clean up memory not used in final aggregation (sort, reduce, hll) |
| 686 | // before aggregation happen |
| 687 | func (bc *oopkBatchContext) cleanupBeforeAggregation() { |
| 688 | for _, column := range bc.columns { |
| 689 | deviceFreeAndSetNil(&column.basePtr) |
| 690 | } |
| 691 | bc.columns = nil |
| 692 | |
| 693 | deviceFreeAndSetNil(&bc.indexVectorD) |
| 694 | deviceFreeAndSetNil(&bc.predicateVectorD) |
| 695 | deviceFreeAndSetNil(&bc.geoPredicateVectorD) |
| 696 | |
| 697 | for _, recordIDsVector := range bc.foreignTableRecordIDsD { |
| 698 | deviceFreeAndSetNil(&recordIDsVector) |
| 699 | } |
| 700 | bc.foreignTableRecordIDsD = nil |
| 701 | |
| 702 | for _, stackFrame := range bc.exprStackD { |
| 703 | deviceFreeAndSetNil(&stackFrame[0]) |
| 704 | } |
| 705 | bc.exprStackD = nil |
| 706 | } |
| 707 | |
| 708 | // swapResultBufferForNextBatch swaps the two |
| 709 | // sets of dim/measure/hash vectors to get ready for the next batch. |
no test coverage detected