Replace std::shared_ptr<File> by std::unique_ptr<File>#1054
Replace std::shared_ptr<File> by std::unique_ptr<File>#1054gfphoenix78 merged 2 commits intoapache:mainfrom
Conversation
eebb3e6 to
ac7ab39
Compare
ac7ab39 to
cebbf2e
Compare
|
A side question about PAX not related to this pr: as far as I can see PAX relies on C++ memory allocators. It doesn't use PG memory contexts, right? This may become problematic for production cases with high memory usage when overcommit is off. |
Yes, the c++ code doesn't use PG memory context. Because we expect to scan multiple pax data file concurrently. High memory usage may throw an exception that will be caught by the wrapper code. When the wrapper catches an exception, it will raise a PG error, the c++ objects will be released in the clean stage. |
84a28c7 to
2860329
Compare
Shared smart pointer will introduce additional cost, and it also make the ownership complicated. Use unique pointer to make the ownership explicitly visible.
The function OrcGroup::GetColumnValue() has a critical performance issue cause by shared smart pointer. This commit replace the shared pointer by unique pointer to eliminate the lock issue.
2860329 to
7322951
Compare
Shared smart pointer will introduce additional cost, and it also make the ownership complicated.
Use unique pointer to make the ownership explicitly visible.
Test Plan
make installcheckmake -C src/test installcheck-cbdb-parallelImpact
Performance:
User-facing changes:
Dependencies:
Checklist
Additional Context
CI Skip Instructions