Research and Implementation on the Methods of Changing PostgreSQL Storage Engine to Mutil-threads Structure
- Author
- XuYan
- Advisor
- GaoJianSheng
- School
- Huazhong University of Science and Technology
- Major
- Software Engineering
- Classification
- TP311.13 Database theory and systems
- Degree
- Master's thesis
- Year
- 2012
- Downloads
- 28
- Citations
- 0
Abstract
An efficient storage engine has important significance to the performance ofdatabase systems. In this thesis, proposed a solution of changing PostgreSQL storageengine from mutil-processes structure to mutil-threads structure for its structuraldefects.PostgreSQL is a mutil-processes database management system, when there is auser connects to the system, a new process will be created to handle the user’sconnection and the process will be destroyed after the user disconnects from the system.Process creation, scheduling, and destruction cost much operating system resource thancorresponding thread operation. In order to the rational use of system resources, weshould use the multi-threads structure.In this paper, analyze and imple ment several aspects involved in changingPostgreSQL storage engine from mutil-processes structure to mutil-threads structure.Proposed thread local storage methods for global variables and discuss the pros andcons between the methods, use Boost third-party libraries and design replacementscheme for thread control, analyze theory of shared message queue method forinter-process communication, discuss virtual file descriptor mechanism for processresource limits. Based on the above analys is, discussed the imple mentation of changingstorage engine to mutil-threads structure. Use message queue with thread informationmethod for thread communication, separate backend process starting into storageengine main thread starting and backend thread starting, start background writerprocess with thread method and describe its normal and exceptional circumstance. Allsingle-thread and multi-thread test case passed under Windows and Linux platforms.This research showed that, storage engine with multi-threads structure be good atsaving system resources and using power of multi-core processors, enhance the overallperformance of the database system. Its can also improve the throughput of thedistributed database system if transactions run in different threads.
Table of contents
Summary 3-4
Abstract 4-7
1 Introduction 7-12
1.1 subject background 7
1.2 purpose and significance of the subject 7-9
1.3 Research Status main contents of this paper 9-10
1.4 10-12
2 PostgreSQL storage engine 12-20
2.1 PostgreSQL architecture 12-13
structure and function 2.2 PostgreSQL storage engine 13-17
2.3 PostgreSQL storage Interface engine 17-18
2.4 PostgreSQL storage engine current problems 18-19
2.5 Summary 19-20
3 PostgreSQL storage multi-threaded engine analysis 20-32
3.1 global variable transformation 20-22
3.2 thread control 22-23
3.3 interprocess communication analysis 23-28
3.4 process resource limits 28-31
3.5 Summary 31-32
4 PostgreSQL storage engine, multi- threading to achieve achieve 32-44
4.1 storage engine thread communication 32-37
achieve 4.2 storage engine background service thread 37-38
4.3 storage engine written back achieve thread 38-43
4.4 Summary 43-44
5 storage engine multi-threaded test 44-50
5.1 test environment 44
5.2 single-threaded test 44-45
5.3 multi-threaded test 45-47
5.4 test results and analysis 47-49
5.5 chapter Summary 49-50
6 summary and Outlook 50-52
6.1 Full Summary 50-51
6.2 Prospects 51-52
Thanks 52-53
References 53-55
Related dissertations
- Foshan Lightning Proof Business System Based on BS Model Design and Implementation
- And implementation of multi buffer pool adaptive configuration design based on PostgreSQL
- Research on Rice Diseases and Pests Comprehensive Management System Based on GRASS
- The Design and Realization of the Information System of Operation and Management at the Early Stage of Radiotherapy
- Design and Implementation of Battery Testing and Network Data Management System
- Study of Shanghai city public cultural facilities spatial pattern measurement model based on the extended SQL
- Research and Design Traffic Information Service Platform Based on WebGIS
- Greenland Information System Based on WebGIS of Open Source
- Research and Improvement of Password Authentication of PostgreSQL Based on Elliptic Curve
- Research and Implementation of Database Fault-Tolerant Backup on Raw I/O of the Kylin Operation System
- Web-based Tool Data Management System under the Open Source Platform
- Linux platform based on vector format Research and Implementation of WebGIS platform
- The Research and Implementation of User Authentication Mechanisms in Database
- Research on Methods of Geo-spatial Data Management Based on Open Source Database PostgreSQL
- Research and Implementation of Materialized Views
- Research on Security Enhanced Model Based Database System
- The Storage and Management about Massive Data Based on PostgreSQL
- Multimedia Search Engine Design Based on Grid Enviroment
- The Design and Implementation of the Online Examining and Judge System
- The XPostgreSQL strategy for XML support