Part VII. Internals

This part contains assorted information that might be of use to Postgres Pro developers.

Table of Contents

47. Overview of Postgres Pro Internals
47.1. The Path of a Query
47.2. How Connections are Established
47.3. The Parser Stage
47.4. The Postgres Pro Rule System
47.5. Planner/Optimizer
47.6. Executor
48. System Catalogs
48.1. Overview
48.2. pg_aggregate
48.3. pg_am
48.4. pg_amop
48.5. pg_amproc
48.6. pg_attrdef
48.7. pg_attribute
48.8. pg_authid
48.9. pg_auth_members
48.10. pg_cast
48.11. pg_class
48.12. pg_collation
48.13. pg_constraint
48.14. pg_conversion
48.15. pg_database
48.16. pg_db_role_setting
48.17. pg_default_acl
48.18. pg_depend
48.19. pg_description
48.20. pg_enum
48.21. pg_event_trigger
48.22. pg_extension
48.23. pg_foreign_data_wrapper
48.24. pg_foreign_server
48.25. pg_foreign_table
48.26. pg_index
48.27. pg_inherits
48.28. pg_init_privs
48.29. pg_language
48.30. pg_largeobject
48.31. pg_largeobject_metadata
48.32. pg_namespace
48.33. pg_opclass
48.34. pg_operator
48.35. pg_opfamily
48.36. pg_pltemplate
48.37. pg_policy
48.38. pg_proc
48.39. pg_range
48.40. pg_replication_origin
48.41. pg_rewrite
48.42. pg_seclabel
48.43. pg_shdepend
48.44. pg_shdescription
48.45. pg_shseclabel
48.46. pg_statistic
48.47. pg_tablespace
48.48. pg_transform
48.49. pg_trigger
48.50. pg_ts_config
48.51. pg_ts_config_map
48.52. pg_ts_dict
48.53. pg_ts_parser
48.54. pg_ts_template
48.55. pg_type
48.56. pg_user_mapping
48.57. System Views
48.58. pg_available_extensions
48.59. pg_available_extension_versions
48.60. pg_config
48.61. pg_cursors
48.62. pg_file_settings
48.63. pg_group
48.64. pg_indexes
48.65. pg_locks
48.66. pg_matviews
48.67. pg_policies
48.68. pg_prepared_statements
48.69. pg_prepared_xacts
48.70. pg_replication_origin_status
48.71. pg_replication_slots
48.72. pg_roles
48.73. pg_rules
48.74. pg_seclabels
48.75. pg_settings
48.76. pg_shadow
48.77. pg_stats
48.78. pg_tables
48.79. pg_timezone_abbrevs
48.80. pg_timezone_names
48.81. pg_user
48.82. pg_user_mappings
48.83. pg_views
49. Frontend/Backend Protocol
49.1. Overview
49.2. Message Flow
49.3. Streaming Replication Protocol
49.4. Message Data Types
49.5. Message Formats
49.6. Error and Notice Message Fields
49.7. Summary of Changes since Protocol 2.0
50. Writing A Procedural Language Handler
51. Writing A Foreign Data Wrapper
51.1. Foreign Data Wrapper Functions
51.2. Foreign Data Wrapper Callback Routines
51.3. Foreign Data Wrapper Helper Functions
51.4. Foreign Data Wrapper Query Planning
51.5. Row Locking in Foreign Data Wrappers
52. Writing A Table Sampling Method
52.1. Sampling Method Support Functions
53. Writing A Custom Scan Provider
53.1. Creating Custom Scan Paths
53.2. Creating Custom Scan Plans
53.3. Executing Custom Scans
54. Genetic Query Optimizer
54.1. Query Handling as a Complex Optimization Problem
54.2. Genetic Algorithms
54.3. Genetic Query Optimization (GEQO) in Postgres Pro
54.4. Further Reading
55. Index Access Method Interface Definition
55.1. Basic API Structure for Indexes
55.2. Index Access Method Functions
55.3. Index Scanning
55.4. Index Locking Considerations
55.5. Index Uniqueness Checks
55.6. Index Cost Estimation Functions
56. Generic WAL Records
57. GiST Indexes
57.1. Introduction
57.2. Built-in Operator Classes
57.3. Extensibility
57.4. Implementation
57.5. Examples
58. SP-GiST Indexes
58.1. Introduction
58.2. Built-in Operator Classes
58.3. Extensibility
58.4. Implementation
58.5. Examples
59. GIN Indexes
59.1. Introduction
59.2. Built-in Operator Classes
59.3. Extensibility
59.4. Implementation
59.5. GIN Tips and Tricks
59.6. Limitations
59.7. Examples
60. BRIN Indexes
60.1. Introduction
60.2. Built-in Operator Classes
60.3. Extensibility
61. Database Physical Storage
61.1. Database File Layout
61.2. TOAST
61.3. Free Space Map
61.4. Visibility Map
61.5. The Initialization Fork
61.6. Database Page Layout
62. BKI Backend Interface
62.1. BKI File Format
62.2. BKI Commands
62.3. Structure of the Bootstrap BKI File
62.4. Example
63. How the Planner Uses Statistics
63.1. Row Estimation Examples
63.2. Planner Statistics and Security