Part VII. Internals

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

Table of Contents

53. Overview of Postgres Pro Internals
53.1. The Path of a Query
53.2. How Connections Are Established
53.3. The Parser Stage
53.4. The Postgres Pro Rule System
53.5. Planner/Optimizer
53.6. Executor
54. System Catalogs
54.1. Overview
54.2. pg_aggregate
54.3. pg_am
54.4. pg_amop
54.5. pg_amproc
54.6. pg_attrdef
54.7. pg_attribute
54.8. pg_authid
54.9. pg_auth_members
54.10. pg_cast
54.11. pg_class
54.12. pg_collation
54.13. pg_constraint
54.14. pg_conversion
54.15. pg_database
54.16. pg_db_role_setting
54.17. pg_default_acl
54.18. pg_depend
54.19. pg_description
54.20. pg_enum
54.21. pg_event_trigger
54.22. pg_extension
54.23. pg_foreign_data_wrapper
54.24. pg_foreign_server
54.25. pg_foreign_table
54.26. pg_index
54.27. pg_inherits
54.28. pg_init_privs
54.29. pg_language
54.30. pg_largeobject
54.31. pg_largeobject_metadata
54.32. pg_namespace
54.33. pg_opclass
54.34. pg_operator
54.35. pg_opfamily
54.36. pg_parameter_acl
54.37. pg_partitioned_table
54.38. pg_policy
54.39. pg_proc
54.40. pg_profile
54.41. pg_publication
54.42. pg_publication_namespace
54.43. pg_publication_rel
54.44. pg_range
54.45. pg_replication_origin
54.46. pg_rewrite
54.47. pg_role_password
54.48. pg_seclabel
54.49. pg_sequence
54.50. pg_shdepend
54.51. pg_shdescription
54.52. pg_shseclabel
54.53. pg_statistic
54.54. pg_statistic_ext
54.55. pg_statistic_ext_data
54.56. pg_subscription
54.57. pg_subscription_rel
54.58. pg_tablespace
54.59. pg_transform
54.60. pg_trigger
54.61. pg_ts_config
54.62. pg_ts_config_map
54.63. pg_ts_dict
54.64. pg_ts_parser
54.65. pg_ts_template
54.66. pg_type
54.67. pg_user_mapping
55. System Views
55.1. Overview
55.2. pg_available_extensions
55.3. pg_available_extension_versions
55.4. pg_backend_memory_contexts
55.5. pg_config
55.6. pg_cursors
55.7. pg_file_settings
55.8. pg_group
55.9. pg_hba_file_rules
55.10. pg_ident_file_mappings
55.11. pg_indexes
55.12. pg_locks
55.13. pg_matviews
55.14. pg_policies
55.15. pg_prepared_statements
55.16. pg_autoprepared_statements
55.17. pg_prepared_xacts
55.18. pg_publication_tables
55.19. pg_replication_origin_status
55.20. pg_replication_slots
55.21. pg_roles
55.22. pg_rules
55.23. pg_seclabels
55.24. pg_sequences
55.25. pg_settings
55.26. pg_shadow
55.27. pg_shmem_allocations
55.28. pg_stats
55.29. pg_stats_ext
55.30. pg_stats_ext_exprs
55.31. pg_tables
55.32. pg_timezone_abbrevs
55.33. pg_timezone_names
55.34. pg_user
55.35. pg_user_mappings
55.36. pg_views
56. Frontend/Backend Protocol
56.1. Overview
56.2. Message Flow
56.3. SASL Authentication
56.4. Streaming Replication Protocol
56.5. Logical Streaming Replication Protocol
56.6. Message Data Types
56.7. Message Formats
56.8. Error and Notice Message Fields
56.9. Logical Replication Message Formats
56.10. Summary of Changes since Protocol 2.0
57. Writing a Procedural Language Handler
58. Writing a Foreign Data Wrapper
58.1. Foreign Data Wrapper Functions
58.2. Foreign Data Wrapper Callback Routines
58.3. Foreign Data Wrapper Helper Functions
58.4. Foreign Data Wrapper Query Planning
58.5. Row Locking in Foreign Data Wrappers
59. Writing a Table Sampling Method
59.1. Sampling Method Support Functions
60. Writing a Custom Scan Provider
60.1. Creating Custom Scan Paths
60.2. Creating Custom Scan Plans
60.3. Executing Custom Scans
61. Genetic Query Optimizer
61.1. Query Handling as a Complex Optimization Problem
61.2. Genetic Algorithms
61.3. Genetic Query Optimization (GEQO) in Postgres Pro
61.4. Further Reading
62. Table Access Method Interface Definition
63. Index Access Method Interface Definition
63.1. Basic API Structure for Indexes
63.2. Index Access Method Functions
63.3. Index Scanning
63.4. Index Locking Considerations
63.5. Index Uniqueness Checks
63.6. Index Cost Estimation Functions
64. Generic WAL Records
65. Custom WAL Resource Managers
66. B-Tree Indexes
66.1. Introduction
66.2. Behavior of B-Tree Operator Classes
66.3. B-Tree Support Functions
66.4. Implementation
67. GiST Indexes
67.1. Introduction
67.2. Built-in Operator Classes
67.3. Extensibility
67.4. Implementation
67.5. Examples
68. SP-GiST Indexes
68.1. Introduction
68.2. Built-in Operator Classes
68.3. Extensibility
68.4. Implementation
69. GIN Indexes
69.1. Introduction
69.2. Built-in Operator Classes
69.3. Extensibility
69.4. Implementation
69.5. GIN Tips and Tricks
69.6. Limitations
69.7. Examples
70. BRIN Indexes
70.1. Introduction
70.2. Built-in Operator Classes
70.3. Extensibility
71. Hash Indexes
71.1. Overview
71.2. Implementation
72. Database Physical Storage
72.1. Database File Layout
72.2. TOAST
72.3. Free Space Map
72.4. Visibility Map
72.5. The Initialization Fork
72.6. Database Page Layout
72.7. Heap-Only Tuples (HOT)
73. How the Planner Uses Statistics
73.1. Row Estimation Examples
73.2. Multivariate Statistics Examples
73.3. Planner Statistics and Security
74. Backup Manifest Format
74.1. Backup Manifest Top-level Object
74.2. Backup Manifest File Object
74.3. Backup Manifest WAL Range Object