Part VII. Internals

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

Table of Contents

55. Overview of Postgres Pro Internals
55.1. The Path of a Query
55.2. How Connections Are Established
55.3. The Parser Stage
55.4. The Postgres Pro Rule System
55.5. Planner/Optimizer
55.6. Executor
56. System Catalogs
56.1. Overview
56.2. pg_aggregate
56.3. pg_am
56.4. pg_amop
56.5. pg_amproc
56.6. pg_attrdef
56.7. pg_attribute
56.8. pg_authid
56.9. pg_auth_members
56.10. pg_cast
56.11. pg_class
56.12. pg_collation
56.13. pg_constraint
56.14. pg_conversion
56.15. pg_database
56.16. pg_db_role_setting
56.17. pg_default_acl
56.18. pg_depend
56.19. pg_description
56.20. pg_enum
56.21. pg_event_trigger
56.22. pg_extension
56.23. pg_foreign_data_wrapper
56.24. pg_foreign_server
56.25. pg_foreign_table
56.26. pg_index
56.27. pg_inherits
56.28. pg_init_privs
56.29. pg_language
56.30. pg_largeobject
56.31. pg_largeobject_metadata
56.32. pg_namespace
56.33. pg_opclass
56.34. pg_operator
56.35. pg_opfamily
56.36. pg_parameter_acl
56.37. pg_partitioned_table
56.38. pg_policy
56.39. pg_proc
56.40. pg_profile
56.41. pg_publication
56.42. pg_publication_namespace
56.43. pg_publication_rel
56.44. pg_range
56.45. pg_replication_origin
56.46. pg_rewrite
56.47. pg_role_password
56.48. pg_seclabel
56.49. pg_sequence
56.50. pg_shdepend
56.51. pg_shdescription
56.52. pg_shseclabel
56.53. pg_statistic
56.54. pg_statistic_ext
56.55. pg_statistic_ext_data
56.56. pg_subscription
56.57. pg_subscription_rel
56.58. pg_tablespace
56.59. pg_transform
56.60. pg_trigger
56.61. pg_ts_config
56.62. pg_ts_config_map
56.63. pg_ts_dict
56.64. pg_ts_parser
56.65. pg_ts_template
56.66. pg_type
56.67. pg_user_mapping
57. System Views
57.1. Overview
57.2. pg_available_extensions
57.3. pg_available_extension_versions
57.4. pg_backend_memory_contexts
57.5. pg_config
57.6. pg_cursors
57.7. pg_file_settings
57.8. pg_group
57.9. pg_hba_file_rules
57.10. pg_ident_file_mappings
57.11. pg_indexes
57.12. pg_locks
57.13. pg_matviews
57.14. pg_policies
57.15. pg_prepared_statements
57.16. pg_autoprepared_statements
57.17. pg_prepared_xacts
57.18. pg_publication_tables
57.19. pg_replication_origin_status
57.20. pg_replication_slots
57.21. pg_roles
57.22. pg_rules
57.23. pg_seclabels
57.24. pg_sequences
57.25. pg_settings
57.26. pg_shadow
57.27. pg_shmem_allocations
57.28. pg_stats
57.29. pg_stats_ext
57.30. pg_stats_ext_exprs
57.31. pg_stats_vacuum_database
57.32. pg_stats_vacuum_indexes
57.33. pg_stats_vacuum_tables
57.34. pg_tables
57.35. pg_timezone_abbrevs
57.36. pg_timezone_names
57.37. pg_user
57.38. pg_user_mappings
57.39. pg_views
58. Frontend/Backend Protocol
58.1. Overview
58.2. Message Flow
58.3. SASL Authentication
58.4. Streaming Replication Protocol
58.5. Logical Streaming Replication Protocol
58.6. Message Data Types
58.7. Message Formats
58.8. Error and Notice Message Fields
58.9. Logical Replication Message Formats
58.10. Summary of Changes since Protocol 2.0
59. Writing a Procedural Language Handler
60. Writing a Foreign Data Wrapper
60.1. Foreign Data Wrapper Functions
60.2. Foreign Data Wrapper Callback Routines
60.3. Foreign Data Wrapper Helper Functions
60.4. Foreign Data Wrapper Query Planning
60.5. Row Locking in Foreign Data Wrappers
61. Writing a Table Sampling Method
61.1. Sampling Method Support Functions
62. Writing a Custom Scan Provider
62.1. Creating Custom Scan Paths
62.2. Creating Custom Scan Plans
62.3. Executing Custom Scans
63. Genetic Query Optimizer
63.1. Query Handling as a Complex Optimization Problem
63.2. Genetic Algorithms
63.3. Genetic Query Optimization (GEQO) in Postgres Pro
63.4. Further Reading
64. Table Access Method Interface Definition
65. Index Access Method Interface Definition
65.1. Basic API Structure for Indexes
65.2. Index Access Method Functions
65.3. Index Scanning
65.4. Index Locking Considerations
65.5. Index Uniqueness Checks
65.6. Index Cost Estimation Functions
66. Generic WAL Records
67. Custom WAL Resource Managers
68. B-Tree Indexes
68.1. Introduction
68.2. Behavior of B-Tree Operator Classes
68.3. B-Tree Support Functions
68.4. Implementation
69. GiST Indexes
69.1. Introduction
69.2. Built-in Operator Classes
69.3. Extensibility
69.4. Implementation
69.5. Examples
70. SP-GiST Indexes
70.1. Introduction
70.2. Built-in Operator Classes
70.3. Extensibility
70.4. Implementation
71. GIN Indexes
71.1. Introduction
71.2. Built-in Operator Classes
71.3. Extensibility
71.4. Implementation
71.5. GIN Tips and Tricks
71.6. Limitations
71.7. Examples
72. BRIN Indexes
72.1. Introduction
72.2. Built-in Operator Classes
72.3. Extensibility
73. Hash Indexes
73.1. Overview
73.2. Implementation
74. Database Physical Storage
74.1. Database File Layout
74.2. TOAST
74.3. Free Space Map
74.4. Visibility Map
74.5. The Initialization Fork
74.6. Database Page Layout
74.7. Heap-Only Tuples (HOT)
75. Transaction Processing
75.1. Transactions and Identifiers
75.2. Transactions and Locking
75.3. Subtransactions
75.4. Two-Phase Transactions
76. How the Planner Uses Statistics
76.1. Row Estimation Examples
76.2. Multivariate Statistics Examples
76.3. Planner Statistics and Security
77. Real-Time Query Replanning
77.1. How It Works
78. Backup Manifest Format
78.1. Backup Manifest Top-level Object
78.2. Backup Manifest File Object
78.3. Backup Manifest WAL Range Object