Part VII. Internals#

Part VII. Internals

Part VII. Internals

This part contains assorted information that might be of use to Tantor BE developers.

Table of Contents

48. Overview of PostgreSQL Internals
48.1. The Path of a Query
48.2. How Connections Are Established
48.3. The Parser Stage
48.4. The Tantor BE Rule System
48.5. Planner/Optimizer
48.6. Executor
49. System Catalogs
49.1. Overview
49.2. pg_aggregate
49.3. pg_am
49.4. pg_amop
49.5. pg_amproc
49.6. pg_attrdef
49.7. pg_attribute
49.8. pg_authid
49.9. pg_auth_members
49.10. pg_cast
49.11. pg_class
49.12. pg_collation
49.13. pg_constraint
49.14. pg_conversion
49.15. pg_database
49.16. pg_db_role_setting
49.17. pg_default_acl
49.18. pg_depend
49.19. pg_description
49.20. pg_enum
49.21. pg_event_trigger
49.22. pg_extension
49.23. pg_foreign_data_wrapper
49.24. pg_foreign_server
49.25. pg_foreign_table
49.26. pg_index
49.27. pg_inherits
49.28. pg_init_privs
49.29. pg_language
49.30. pg_largeobject
49.31. pg_largeobject_metadata
49.32. pg_namespace
49.33. pg_opclass
49.34. pg_operator
49.35. pg_opfamily
49.36. pg_parameter_acl
49.37. pg_partitioned_table
49.38. pg_policy
49.39. pg_proc
49.40. pg_publication
49.41. pg_publication_namespace
49.42. pg_publication_rel
49.43. pg_range
49.44. pg_replication_origin
49.45. pg_rewrite
49.46. pg_seclabel
49.47. pg_sequence
49.48. pg_shdepend
49.49. pg_shdescription
49.50. pg_shseclabel
49.51. pg_statistic
49.52. pg_statistic_ext
49.53. pg_statistic_ext_data
49.54. pg_subscription
49.55. pg_subscription_rel
49.56. pg_tablespace
49.57. pg_transform
49.58. pg_trigger
49.59. pg_ts_config
49.60. pg_ts_config_map
49.61. pg_ts_dict
49.62. pg_ts_parser
49.63. pg_ts_template
49.64. pg_type
49.65. pg_user_mapping
50. System Views
50.1. Overview
50.2. pg_available_extensions
50.3. pg_available_extension_versions
50.4. pg_backend_memory_contexts
50.5. pg_config
50.6. pg_cursors
50.7. pg_file_settings
50.8. pg_group
50.9. pg_hba_file_rules
50.10. pg_ident_file_mappings
50.11. pg_indexes
50.12. pg_locks
50.13. pg_matviews
50.14. pg_policies
50.15. pg_prepared_statements
50.16. pg_prepared_xacts
50.17. pg_publication_tables
50.18. pg_replication_origin_status
50.19. pg_replication_slots
50.20. pg_roles
50.21. pg_rules
50.22. pg_seclabels
50.23. pg_sequences
50.24. pg_settings
50.25. pg_shadow
50.26. pg_shmem_allocations
50.27. pg_stats
50.28. pg_stats_ext
50.29. pg_stats_ext_exprs
50.30. pg_tables
50.31. pg_timezone_abbrevs
50.32. pg_timezone_names
50.33. pg_user
50.34. pg_user_mappings
50.35. pg_views
50.36. pg_wait_events
51. Frontend/Backend Protocol
51.1. Overview
51.2. Message Flow
51.3. SASL Authentication
51.4. Streaming Replication Protocol
51.5. Logical Streaming Replication Protocol
51.6. Message Data Types
51.7. Message Formats
51.8. Error and Notice Message Fields
51.9. Logical Replication Message Formats
51.10. Summary of Changes since Protocol 2.0
52. PostgreSQL Coding Conventions
52.1. Formatting
52.2. Reporting Errors Within the Server
52.3. Error Message Style Guide
52.4. Miscellaneous Coding Conventions
53. Native Language Support
53.1. For the Translator
53.2. For the Programmer
54. Writing a Procedural Language Handler
55. Writing a Foreign Data Wrapper
55.1. Foreign Data Wrapper Functions
55.2. Foreign Data Wrapper Callback Routines
55.3. Foreign Data Wrapper Helper Functions
55.4. Foreign Data Wrapper Query Planning
55.5. Row Locking in Foreign Data Wrappers
56. Writing a Table Sampling Method
56.1. Sampling Method Support Functions
57. Writing a Custom Scan Provider
57.1. Creating Custom Scan Paths
57.2. Creating Custom Scan Plans
57.3. Executing Custom Scans
58. Genetic Query Optimizer
58.1. Query Handling as a Complex Optimization Problem
58.2. Genetic Algorithms
58.3. Genetic Query Optimization (GEQO) in PostgreSQL
58.4. Further Reading
59. Table Access Method Interface Definition
60. Index Access Method Interface Definition
60.1. Basic API Structure for Indexes
60.2. Index Access Method Functions
60.3. Index Scanning
60.4. Index Locking Considerations
60.5. Index Uniqueness Checks
60.6. Index Cost Estimation Functions
61. Write Ahead Logging for Extensions
61.1. Generic WAL Records
61.2. Custom WAL Resource Managers
62. Built-in Index Access Methods
62.1. B-Tree Indexes
62.2. GiST Indexes
62.3. SP-GiST Indexes
62.4. GIN Indexes
62.5. BRIN Indexes
62.6. Hash Indexes
63. Database Physical Storage
63.1. Database File Layout
63.2. TOAST
63.3. Free Space Map
63.4. Visibility Map
63.5. The Initialization Fork
63.6. Database Page Layout
63.7. Heap-Only Tuples (HOT)
64. Transaction Processing
64.1. Transactions and Identifiers
64.2. Transactions and Locking
64.3. Subtransactions
64.4. Two-Phase Transactions
65. System Catalog Declarations and Initial Contents
65.1. System Catalog Declaration Rules
65.2. System Catalog Initial Data
65.3. BKI File Format
65.4. BKI Commands
65.5. Structure of the Bootstrap BKI File
65.6. BKI Example
66. How the Planner Uses Statistics
66.1. Row Estimation Examples
66.2. Multivariate Statistics Examples
66.3. Planner Statistics and Security
67. Backup Manifest Format
67.1. Backup Manifest Top-level Object
67.2. Backup Manifest File Object
67.3. Backup Manifest WAL Range Object