Part VII. Internals

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

Table of Contents

46. Overview of LightDB Internals
46.1. The Path of a Query
46.2. How Connections Are Established
46.3. The Parser Stage
46.4. The LightDB Rule System
46.5. Planner/Optimizer
46.6. Executor
47. System Catalogs
47.1. Overview
47.2. lt_attri_ext
47.3. lt_database_ext
47.4. lt_global_temp_table_ext
47.5. lt_package
47.6. lt_partition_ext
47.7. lt_proc_ext
47.8. lt_trigger_ext
47.9. lt_type_ext
47.10. lt_variable
47.11. lt_namespace_ext
47.12. pg_aggregate
47.13. pg_am
47.14. pg_amop
47.15. pg_amproc
47.16. pg_attrdef
47.17. pg_attribute
47.18. pg_authid
47.19. pg_auth_members
47.20. pg_cast
47.21. pg_class
47.22. pg_collation
47.23. pg_constraint
47.24. pg_conversion
47.25. pg_database
47.26. pg_db_role_setting
47.27. pg_default_acl
47.28. pg_depend
47.29. pg_description
47.30. pg_enum
47.31. pg_event_trigger
47.32. pg_extension
47.33. pg_foreign_data_wrapper
47.34. pg_foreign_server
47.35. pg_foreign_table
47.36. pg_index
47.37. pg_inherits
47.38. pg_init_privs
47.39. pg_language
47.40. pg_largeobject
47.41. pg_largeobject_metadata
47.42. pg_namespace
47.43. pg_opclass
47.44. pg_operator
47.45. pg_opfamily
47.46. pg_partitioned_table
47.47. pg_policy
47.48. pg_proc
47.49. pg_publication
47.50. pg_publication_rel
47.51. pg_range
47.52. pg_replication_origin
47.53. pg_rewrite
47.54. pg_seclabel
47.55. pg_sequence
47.56. pg_shdepend
47.57. pg_shdescription
47.58. pg_shseclabel
47.59. pg_statistic
47.60. pg_statistic_ext
47.61. pg_statistic_ext_data
47.62. pg_subscription
47.63. pg_subscription_rel
47.64. pg_tablespace
47.65. pg_transform
47.66. pg_trigger
47.67. pg_ts_config
47.68. pg_ts_config_map
47.69. pg_ts_dict
47.70. pg_ts_parser
47.71. pg_ts_template
47.72. pg_type
47.73. pg_user_mapping
47.74. System Views
47.75. pg_available_extensions
47.76. pg_available_extension_versions
47.77. pg_config
47.78. pg_cursors
47.79. pg_file_settings
47.80. pg_group
47.81. pg_hba_file_rules
47.82. pg_indexes
47.83. pg_locks
47.84. pg_matviews
47.85. pg_policies
47.86. pg_prepared_statements
47.87. pg_prepared_xacts
47.88. pg_publication_tables
47.89. pg_replication_origin_status
47.90. pg_replication_slots
47.91. pg_roles
47.92. pg_rules
47.93. pg_seclabels
47.94. pg_sequences
47.95. pg_settings
47.96. pg_shadow
47.97. pg_shmem_allocations
47.98. pg_stats
47.99. pg_stats_ext
47.100. pg_tables
47.101. pg_timezone_abbrevs
47.102. pg_timezone_names
47.103. pg_user
47.104. pg_user_mappings
47.105. pg_views
48. Frontend/Backend Protocol
48.1. Overview
48.2. Message Flow
48.3. SASL Authentication
48.4. Streaming Replication Protocol
48.5. Logical Streaming Replication Protocol
48.6. Message Data Types
48.7. Message Formats
48.8. Error and Notice Message Fields
48.9. Logical Replication Message Formats
48.10. Summary of Changes since Protocol 2.0
49. LightDB Coding Conventions
49.1. Formatting
49.2. Reporting Errors Within the Server
49.3. Error Message Style Guide
49.4. Miscellaneous Coding Conventions
50. Native Language Support
50.1. For the Translator
50.2. For the Programmer
51. Writing a Procedural Language Handler
52. Writing a Foreign Data Wrapper
52.1. Foreign Data Wrapper Functions
52.2. Foreign Data Wrapper Callback Routines
52.3. Foreign Data Wrapper Helper Functions
52.4. Foreign Data Wrapper Query Planning
52.5. Row Locking in Foreign Data Wrappers
53. Writing a Table Sampling Method
53.1. Sampling Method Support Functions
54. Writing a Custom Scan Provider
54.1. Creating Custom Scan Paths
54.2. Creating Custom Scan Plans
54.3. Executing Custom Scans
55. Table Access Method Interface Definition
56. Index Access Method Interface Definition
56.1. Basic API Structure for Indexes
56.2. Index Access Method Functions
56.3. Index Scanning
56.4. Index Locking Considerations
56.5. Index Uniqueness Checks
56.6. Index Cost Estimation Functions
57. Generic WAL Records
58. B-Tree Indexes
58.1. Introduction
58.2. Behavior of B-Tree Operator Classes
58.3. B-Tree Support Functions
58.4. Implementation
59. GiST Indexes
59.1. Introduction
59.2. Built-in Operator Classes
59.3. Extensibility
59.4. Implementation
59.5. Examples
60. GIN Indexes
60.1. Introduction
60.2. Built-in Operator Classes
60.3. Extensibility
60.4. Implementation
60.5. GIN Tips and Tricks
60.6. Limitations
60.7. Examples
61. Hash Indexes
61.1. Overview
61.2. Implementation
62. Database Physical Storage
62.1. Database File Layout
62.2. TOAST
62.3. Free Space Map
62.4. Visibility Map
62.5. The Initialization Fork
62.6. Database Page Layout
63. System Catalog Declarations and Initial Contents
63.1. System Catalog Declaration Rules
63.2. System Catalog Initial Data
63.3. BKI File Format
63.4. BKI Commands
63.5. Structure of the Bootstrap BKI File
63.6. BKI Example
64. How the Planner Uses Statistics
64.1. Row Estimation Examples
64.2. Multivariate Statistics Examples
64.3. Planner Statistics and Security
65. Backup Manifest Format
65.1. Backup Manifest Top-level Object
65.2. Backup Manifest File Object
65.3. Backup Manifest WAL Range Object
English|中文