Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the structure under the pg source src/backend/ directory?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

What is the structure of the pg source src/backend/ directory? in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

1. Src\ backend\ acess: a very important directory, the data access layer, stores code related to indexing and transaction processing. Such as "figure 3-transaction processing and indexing related structure Diagram" (http://blog.163.com/li_hx/blog/static/183991413201152884321219/). Below this layer is the data buffer, and then the lower layer is the real data storage layer.

2. Src\ backend\ bootstrap: the code to be used when initializing the database. It is closely related to the initdb tool under src\ bin\ initdb.

3. The operation code for system tables provided by src\ backend\ catalog:PG. The system table is defined in incl?\ catalog.

4. The corresponding operation code when the specific command is executed after the src\ backend\ commands:SQL command is parsed.

5. The src\ backend\ executor:SQL command is parsed to get the parsing tree and the query plan. Formally, they are all multi-forked trees, and each subtree consists of several subtrees and nodes (node). The execution mode of different nodes is different after being judged by the system, such as whether to perform sequential scan, index scan or nested loop and so on. Complete the query processing function in conjunction with the code in the commands directory.

6. Src\ backend\ lib: string processing and linked list processing helper functions.

7. Src\ backend\ libpq: code related to authentication or password identification for secure network communication. Such as ssl,md5 and so on.

8. The main function of src\ backend\ main:PG. PG starts the portal.

9. Src\ backend\ nodes: parse or query the processing code of the node on the plan, such as copying the node if necessary.

10. Src\ backend\ optimizer: the code that implements query optimization.

11. Src\ backend\ parser: the code that parses the SQL statement. Note the gram.y file.

12. Src\ backen\ po: implement part of the internationalization (i18n) function. Internationalize some of the tips in the database.

13. Src\ backend\ port: shield the differences in some implementations of different operating systems. Such as socket on windows, support for system function on darwin system, support for float type on sunos4 system, etc.

14. The main process of src\ backend\ postmaster:PG. Such as the main service process postmaster, archiving process pgarch and so on.

15. Src\ backend\ regex: processing code for regular expressions.

16. The query for src\ backend\ rewrite:PG rewrites the system code.

17. Src\ backend\ snowball: code that supports full-text search.

18. Src\ backend\ storage: a very important directory. Code related to the physical storage system. It mainly includes storage manager (which can easily provide multiple storage modes), buffer management, file management, file space management, large object management, lock management, cache synchronization using message queue, and so on. Such as "figure 5-storage system code structure diagram".

19. Src\ backend\ tcop: the service process that actually handles the user's SQL?-postgres.

20. Src\ backend\ tserach: code related to full-text search.

21. Src\ backend\ utils: accessibility code. For example, the processing code for various data types in the adt directory; some cache support in the cache directory, such as query plan caching; the error handling mechanism of the PG system in the error directory; the function management mechanism provided by PG in the fmgr directory; internationalization support (multi-byte characters) in the mb directory; the misc directory provides a mechanism for handling system parameters; the mmgr directory provides PG code for memory management, and so on.

The answer to the question about the structure of the pg source src/backend/ directory is shared here. I hope the above content can be of some help to everyone. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report