Improve efficiency in pg_lock_status()
Allocate memory of CdbPgResults.pg_results with palloc0() instead of calloc(), and free the memory afer use. The CdbPgResults.pg_results array that is returned from various dispatch functions is allocated by cdbdisp_returnResults() via calloc(), but in most cases the memory is not free()-ed after use. To avoid memory leak, the array is now allocated with palloc0() and recycled with pfree(). Track which row and which result set is being processed in function context in pg_lock_status(), so that an ineffient inner loop can be eliminated. Author: Fang Zheng <zhengfang.xjtu@gmail.com>
Showing
想要评论请 注册 或 登录