Part VII. Internals

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

Table of Contents

47. Overview of LightDB Internals
47.1. The Path of a Query
47.2. How Connections Are Established
47.3. The Parser Stage
47.4. The LightDB Rule System
47.5. Planner/Optimizer
47.6. Executor
48. System Catalogs
48.1. Overview
48.2. lt_attri_ext
48.3. lt_database_ext
48.4. lt_global_temp_table_ext
48.5. lt_package
48.6. lt_partition_ext
48.7. lt_type_ext
48.8. pg_aggregate
48.9. pg_am
48.10. pg_amop
48.11. pg_amproc
48.12. pg_attrdef
48.13. pg_attribute
48.14. pg_authid
48.15. pg_auth_members
48.16. pg_cast
48.17. pg_class
48.18. pg_collation
48.19. pg_constraint
48.20. pg_conversion
48.21. pg_database
48.22. pg_db_role_setting
48.23. pg_default_acl
48.24. pg_depend
48.25. pg_description
48.26. pg_enum
48.27. pg_event_trigger
48.28. pg_extension
48.29. pg_foreign_data_wrapper
48.30. pg_foreign_server
48.31. pg_foreign_table
48.32. pg_index
48.33. pg_inherits
48.34. pg_init_privs
48.35. pg_language
48.36. pg_largeobject
48.37. pg_largeobject_metadata
48.38. pg_namespace
48.39. pg_opclass
48.40. pg_operator
48.41. pg_opfamily
48.42. pg_partitioned_table
48.43. pg_policy
48.44. pg_proc
48.45. pg_publication
48.46. pg_publication_rel
48.47. pg_range
48.48. pg_replication_origin
48.49. pg_rewrite
48.50. pg_seclabel
48.51. pg_sequence
48.52. pg_shdepend
48.53. pg_shdescription
48.54. pg_shseclabel
48.55. pg_statistic
48.56. pg_statistic_ext
48.57. pg_statistic_ext_data
48.58. pg_subscription
48.59. pg_subscription_rel
48.60. pg_tablespace
48.61. pg_transform
48.62. pg_trigger
48.63. pg_ts_config
48.64. pg_ts_config_map
48.65. pg_ts_dict
48.66. pg_ts_parser
48.67. pg_ts_template
48.68. pg_type
48.69. pg_user_mapping
48.70. System Views
48.71. pg_available_extensions
48.72. pg_available_extension_versions
48.73. pg_config
48.74. pg_cursors
48.75. pg_file_settings
48.76. pg_group
48.77. pg_hba_file_rules
48.78. pg_indexes
48.79. pg_locks
48.80. pg_matviews
48.81. pg_policies
48.82. pg_prepared_statements
48.83. pg_prepared_xacts
48.84. pg_publication_tables
48.85. pg_replication_origin_status
48.86. pg_replication_slots
48.87. pg_roles
48.88. pg_rules
48.89. pg_seclabels
48.90. pg_sequences
48.91. pg_settings
48.92. pg_shadow
48.93. pg_shmem_allocations
48.94. pg_stats
48.95. pg_stats_ext
48.96. pg_tables
48.97. pg_timezone_abbrevs
48.98. pg_timezone_names
48.99. pg_user
48.100. pg_user_mappings
48.101. pg_views
49. Frontend/Backend Protocol
49.1. Overview
49.2. Message Flow
49.3. SASL Authentication
49.4. Streaming Replication Protocol
49.5. Logical Streaming Replication Protocol
49.6. Message Data Types
49.7. Message Formats
49.8. Error and Notice Message Fields
49.9. Logical Replication Message Formats
49.10. Summary of Changes since Protocol 2.0
50. LightDB Coding Conventions
50.1. Formatting
50.2. Reporting Errors Within the Server
50.3. Error Message Style Guide
50.4. Miscellaneous Coding Conventions
51. Native Language Support
51.1. For the Translator
51.2. For the Programmer
52. Writing a Procedural Language Handler
53. Writing a Foreign Data Wrapper
53.1. Foreign Data Wrapper Functions
53.2. Foreign Data Wrapper Callback Routines
53.3. Foreign Data Wrapper Helper Functions
53.4. Foreign Data Wrapper Query Planning
53.5. Row Locking in Foreign Data Wrappers
54. Writing a Table Sampling Method
54.1. Sampling Method Support Functions
55. Writing a Custom Scan Provider
55.1. Creating Custom Scan Paths
55.2. Creating Custom Scan Plans
55.3. Executing Custom Scans
56. Genetic Query Optimizer
56.1. Query Handling as a Complex Optimization Problem
56.2. Genetic Algorithms
56.3. Genetic Query Optimization (GEQO) in LightDB
56.4. Further Reading
57. Table Access Method Interface Definition
58. Index Access Method Interface Definition
58.1. Basic API Structure for Indexes
58.2. Index Access Method Functions
58.3. Index Scanning
58.4. Index Locking Considerations
58.5. Index Uniqueness Checks
58.6. Index Cost Estimation Functions
59. Generic WAL Records
60. B-Tree Indexes
60.1. Introduction
60.2. Behavior of B-Tree Operator Classes
60.3. B-Tree Support Functions
60.4. Implementation
61. GiST Indexes
61.1. Introduction
61.2. Built-in Operator Classes
61.3. Extensibility
61.4. Implementation
61.5. Examples
62. SP-GiST Indexes
62.1. Introduction
62.2. Built-in Operator Classes
62.3. Extensibility
62.4. Implementation
62.5. Examples
63. GIN Indexes
63.1. Introduction
63.2. Built-in Operator Classes
63.3. Extensibility
63.4. Implementation
63.5. GIN Tips and Tricks
63.6. Limitations
63.7. Examples
64. BRIN Indexes
64.1. Introduction
64.2. Built-in Operator Classes
64.3. Extensibility
65. Hash Indexes
65.1. Overview
65.2. Implementation
66. Database Physical Storage
66.1. Database File Layout
66.2. TOAST
66.3. Free Space Map
66.4. Visibility Map
66.5. The Initialization Fork
66.6. Database Page Layout
67. System Catalog Declarations and Initial Contents
67.1. System Catalog Declaration Rules
67.2. System Catalog Initial Data
67.3. BKI File Format
67.4. BKI Commands
67.5. Structure of the Bootstrap BKI File
67.6. BKI Example
68. How the Planner Uses Statistics
68.1. Row Estimation Examples
68.2. Multivariate Statistics Examples
68.3. Planner Statistics and Security
69. Backup Manifest Format
69.1. Backup Manifest Top-level Object
69.2. Backup Manifest File Object
69.3. Backup Manifest WAL Range Object
English|中文