- Learning PostgreSQL 10(Second Edition)
- Salahaldin Juba Andrey Volkov
- 363字
- 2021-07-02 22:42:07
PostgreSQL architecture
PostgreSQL uses the client/server model, where the client and server programs can be on different hosts. The communication between the client and server is normally done via TCP/IP protocols or via Linux sockets. PostgreSQL can handle multiple connections from a client. A common PostgreSQL program consists of the following operating system processes:
- Client process or program (frontend): The database frontend application performs a database action. The frontend can be a web server that wants to display a web page or a command-line tool to do maintenance tasks. PostgreSQL provides frontend tools such as psql, createdb, dropdb, and createuser.
- Server process (backend): The server process manages database files, accepts connections from client applications, and performs actions on behalf of the client. The server process name is postgres. PostgreSQL forks a new process for each new connection; thus, client and server processes communicate with each other without the intervention of the server main process (postgres), and they have a certain lifetime that is determined by accepting and terminating a client connection.
The aforementioned abstract conceptual PostgreSQL architecture gives an overview of the PostgreSQL capabilities and its interaction with the client, and the operating system. The PostgreSQL server could be pided roughly into four subsystems, as follows:

- Process manager: The process manager manages client connections such as forking and the terminating process.
- Query processor: When a client sends a query to PostgreSQL, the query is parsed by the parser, and then the traffic cop subsystem determines the query type. A utility query is passed to the utilities subsystem. Select, insert, update, and delete queries are rewritten by the rewriter following which an execution plan is generated by the planner. Finally, the query is executed and the result is returned to the client.
- Utilities: The utilities subsystem provides a means to maintain the database such as claiming storage, updating statistics, exporting and importing data with a certain format, and logging.
- Storage manager: The storage manager handles the memory cache, disk buffers, and storage allocation.
Almost all PostgreSQL components can be configured, including a logger, planner, statistical analyzer, and storage manager. PostgreSQL configuration is governed by the nature of the application, such as OLAP and OLTP.
- Verilog HDL數字系統設計入門與應用實例
- WOW!Illustrator CS6完全自學寶典
- Dreamweaver 8中文版商業案例精粹
- 圖形圖像處理(Photoshop)
- VMware Performance and Capacity Management(Second Edition)
- 數據產品經理:解決方案與案例分析
- Photoshop CS3圖層、通道、蒙版深度剖析寶典
- 從零開始學C++
- Hands-On Data Warehousing with Azure Data Factory
- Mastering Ceph
- Python文本分析
- 51單片機應用程序開發與實踐
- EDA技術及其創新實踐(Verilog HDL版)
- 軟件需求最佳實踐
- 巧學活用電腦維護108問