- Notifications
You must be signed in to change notification settings - Fork5
Commita9ed875
committed
Code review for tqueue.c: fix memory leaks, speed it up, other fixes.
When doing record typmod remapping, tqueue.c did fresh catalog lookupsfor each tuple it processed, which was pretty horrible performance-wise(it seemed to about halve the already none-too-quick speed of bulk readsin parallel mode). Worse, it insisted on putting bits of that data intoTopMemoryContext, from where it never freed them, causing asession-lifespan memory leak. (I suppose this was coded with the ideathat the sender process would quit after finishing the query ---but the receiver uses the same code.)Restructure to avoid repetitive catalog lookups and to keep that datain a query-lifespan context, in or below the context where theTQueueDestReceiver or TupleQueueReader itself lives.Fix some other bugs such as continuing to use a tupledesc afterreleasing our refcount on it. Clean up cavalier datatype choices(typmods are int32, please, not int, and certainly not Oid). Improvecomments and error message wording.1 parentf9e439b commita9ed875
1 file changed
+695
-447
lines changed0 commit comments
Comments
(0)