# pg_test_timing
## Name
pg_test_timing?--?measure timing overhead
## Synopsis
`pg_test_timing` [`_option_`...]
## Description
pg_test_timing is a tool to measure the timing overhead on your system and confirm that the system time never moves backwards. Systems that are slow to collect timing data can give less accurate `EXPLAIN ANALYZE` results.
## Options
pg_test_timing accepts the following command-line options:
`-d` `_duration_``--duration=``_duration_`
Specifies the test duration, in seconds. Longer durations give slightly better accuracy, and are more likely to discover problems with the system clock moving backwards. The default test duration is 3 seconds.
`-V`
`--version`
Print the pg_test_timing version and exit.
`-?`
`--help`
Show help about pg_test_timing command line arguments, and exit.
## Usage
### Interpreting results
Good results will show most (>90%) individual timing calls take less than one microsecond. Average per loop overhead will be even lower, below 100 nanoseconds. This example from an Intel i7-860 system using a TSC clock source shows excellent performance:
```
Testing timing overhead for 3 seconds.
Per loop time including overhead: 35.96 nsec
Histogram of timing durations:
< usec % of total count
1 96.40465 80435604
2 3.59518 2999652
4 0.00015 126
8 0.00002 13
16 0.00000 2
```
Note that different units are used for the per loop time than the histogram. The loop can have resolution within a few nanoseconds (nsec), while the individual timing calls can only resolve down to one microsecond (usec).
### Measuring executor timing overhead
When the query executor is running a statement using `EXPLAIN ANALYZE`, individual operations are timed as well as showing a summary. The overhead of your system can be checked by counting rows with the psql program:
```
CREATE TABLE t AS SELECT * FROM generate_series(1,100000);
\timing
SELECT COUNT(*) FROM t;
EXPLAIN ANALYZE SELECT COUNT(*) FROM t;
```
The i7-860 system measured runs the count query in 9.8 ms while the `EXPLAIN ANALYZE` version takes 16.6 ms, each processing just over 100,000 rows. That 6.8 ms difference means the timing overhead per row is 68 ns, about twice what pg_test_timing estimated it would be. Even that relatively small amount of overhead is making the fully timed count statement take almost 70% longer. On more substantial queries, the timing overhead would be less problematic.
### Changing time sources
On some newer Linux systems, it's possible to change the clock source used to collect timing data at any time. A second example shows the slowdown possible from switching to the slower acpi_pm time source, on the same system used for the fast results above:
```
# cat /sys/devices/system/clocksource/clocksource0/available_clocksource
tsc hpet acpi_pm
# echo acpi_pm > /sys/devices/system/clocksource/clocksource0/current_clocksource
# pg_test_timing
Per loop time including overhead: 722.92 nsec
Histogram of timing durations:
< usec % of total count
1 27.84870 1155682
2 72.05956 2990371
4 0.07810 3241
8 0.01357 563
16 0.00007 3
```
In this configuration, the sample `EXPLAIN ANALYZE` above takes 115.9 ms. That's 1061 nsec of timing overhead, again a small multiple of what's measured directly by this utility. That much timing overhead means the actual query itself is only taking a tiny fraction of the accounted for time, most of it is being consumed in overhead instead. In this configuration, any `EXPLAIN ANALYZE` totals involving many timed operations would be inflated significantly by timing overhead.
FreeBSD also allows changing the time source on the fly, and it logs information about the timer selected during boot:
```
# dmesg | grep "Timecounter"
Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
Timecounter "i8254" frequency 1193182 Hz quality 0
Timecounters tick every 10.000 msec
Timecounter "TSC" frequency 2531787134 Hz quality 800
# sysctl kern.timecounter.hardware=TSC
kern.timecounter.hardware: ACPI-fast -> TSC
```
Other systems may only allow setting the time source on boot. On older Linux systems the "clock" kernel setting is the only way to make this sort of change. And even on some more recent ones, the only option you'll see for a clock source is "jiffies". Jiffies are the older Linux software clock implementation, which can have good resolution when it's backed by fast enough timing hardware, as in this example:
```
$ cat /sys/devices/system/clocksource/clocksource0/available_clocksource
jiffies
$ dmesg | grep time.c
time.c: Using 3.579545 MHz WALL PM GTOD PIT/TSC timer.
time.c: Detected 2400.153 MHz processor.
$ pg_test_timing
Testing timing overhead for 3 seconds.
Per timing duration including loop overhead: 97.75 ns
Histogram of timing durations:
< usec % of total count
1 90.23734 27694571
2 9.75277 2993204
4 0.00981 3010
8 0.00007 22
16 0.00000 1
32 0.00000 1
```
### Clock hardware and timing accuracy
Collecting accurate timing information is normally done on computers using hardware clocks with various levels of accuracy. With some hardware the operating systems can pass the system clock time almost directly to programs. A system clock can also be derived from a chip that simply provides timing interrupts, periodic ticks at some known time interval. In either case, operating system kernels provide a clock source that hides these details. But the accuracy of that clock source and how quickly it can return results varies based on the underlying hardware.
Inaccurate time keeping can result in system instability. Test any change to the clock source very carefully. Operating system defaults are sometimes made to favor reliability over best accuracy. And if you are using a virtual machine, look into the recommended time sources compatible with it. Virtual hardware faces additional difficulties when emulating timers, and there are often per operating system settings suggested by vendors.
The Time Stamp Counter (TSC) clock source is the most accurate one available on current generation CPUs. It's the preferred way to track the system time when it's supported by the operating system and the TSC clock is reliable. There are several ways that TSC can fail to provide an accurate timing source, making it unreliable. Older systems can have a TSC clock that varies based on the CPU temperature, making it unusable for timing. Trying to use TSC on some older multicore CPUs can give a reported time that's inconsistent among multiple cores. This can result in the time going backwards, a problem this program checks for. And even the newest systems can fail to provide accurate TSC timing with very aggressive power saving configurations.
Newer operating systems may check for the known TSC problems and switch to a slower, more stable clock source when they are seen. If your system supports TSC time but doesn't default to that, it may be disabled for a good reason. And some operating systems may not detect all the possible problems correctly, or will allow using TSC even in situations where it's known to be inaccurate.
The High Precision Event Timer (HPET) is the preferred timer on systems where it's available and TSC is not accurate. The timer chip itself is programmable to allow up to 100 nanosecond resolution, but you may not see that much accuracy in your system clock.
Advanced Configuration and Power Interface (ACPI) provides a Power Management (PM) Timer, which Linux refers to as the acpi_pm. The clock derived from acpi_pm will at best provide 300 nanosecond resolution.
Timers used on older PC hardware include the 8254 Programmable Interval Timer (PIT), the real-time clock (RTC), the Advanced Programmable Interrupt Controller (APIC) timer, and the Cyclone timer. These timers aim for millisecond resolution.
## Author
Ants Aasma `<[ants.aasma@eesti.ee](mailto:ants.aasma@eesti.ee)>`
## See Also
[EXPLAIN](#calibre_link-575)
- 前言
- 何為PostgreSQL?
- PostgreSQL簡史
- 格式約定
- 更多信息
- 臭蟲匯報指導
- I. 教程
- Chapter 1. 從頭開始
- 1.1. 安裝
- 1.2. 體系基本概念
- 1.3. 創建一個數據庫
- 1.4. 訪問數據庫
- Chapter 2. SQL語言
- 2.1. 介紹
- 2.2. 概念
- 2.3. 創建新表
- 2.4. 向表中添加行
- 2.5. 查詢一個表
- 2.6. 在表間連接
- 2.7. 聚集函數
- 2.8. 更新
- 2.9. 刪除
- Chapter 3. 高級特性
- 3.1. 介紹
- 3.2. 視圖
- 3.3. 外鍵
- 3.4. 事務
- 3.5. 窗口函數
- 3.6. 繼承
- 3.7. 結論
- II. SQL 語言
- Chapter 4. SQL語法
- 4.1. 詞法結構
- 4.2. 值表達式
- 4.3. 調用函數
- Chapter 5. 數據定義
- 5.1. 表的基本概念
- 5.2. 缺省值
- 5.3. 約束
- 5.4. 系統字段
- 5.5. 修改表
- 5.6. 權限
- 5.7. 模式
- 5.8. 繼承
- 5.9. 分區
- 5.10. 外部數據
- 5.11. 其它數據庫對象
- 5.12. 依賴性跟蹤
- Chapter 6. 數據操作
- 6.1. 插入數據
- 6.2. 更新數據
- 6.3. 刪除數據
- Chapter 7. 查詢
- 7.1. 概述
- 7.2. 表表達式
- 7.3. 選擇列表
- 7.4. 組合查詢
- 7.5. 行排序
- 7.6. LIMIT和OFFSET
- 7.7. VALUES列表
- 7.8. WITH 查詢 (通用表表達式)
- Chapter 8. 數據類型
- 8.1. 數值類型
- 8.2. 貨幣類型
- 8.3. 字符類型
- 8.4. 二進制數據類型
- 8.5. 日期/時間類型
- 8.6. 布爾類型
- 8.7. 枚舉類型
- 8.8. 幾何類型
- 8.9. 網絡地址類型
- 8.10. 位串類型
- 8.11. 文本搜索類型
- 8.12. UUID 類型
- 8.13. XML 類型
- 8.14. JSON 類型
- 8.15. Arrays
- 8.16. 復合類型
- 8.17. 范圍類型
- 8.18. 對象標識符類型
- 8.19. 偽類型
- Chapter 9. 函數和操作符
- 9.1. 邏輯操作符
- 9.2. 比較操作符
- 9.3. 數學函數和操作符
- 9.4. 字符串函數和操作符
- 9.5. 二進制字符串函數和操作符
- 9.6. 位串函數和操作符
- 9.7. 模式匹配
- 9.8. 數據類型格式化函數
- 9.9. 時間/日期函數和操作符
- 9.10. 支持枚舉函數
- 9.11. 幾何函數和操作符
- 9.12. 網絡地址函數和操作符
- 9.13. 文本檢索函數和操作符
- 9.14. XML 函數
- 9.15. JSON 函數和操作符
- 9.16. 序列操作函數
- 9.17. 條件表達式
- 9.18. 數組函數和操作符
- 9.19. 范圍函數和操作符
- 9.20. 聚集函數
- 9.21. 窗口函數
- 9.22. 子查詢表達式
- 9.23. 行和數組比較
- 9.24. 返回集合的函數
- 9.25. 系統信息函數
- 9.26. 系統管理函數
- 9.27. 觸發器函數
- 9.28. 事件觸發函數
- Chapter 10. 類型轉換
- 10.1. 概述
- 10.2. 操作符
- 10.3. 函數
- 10.4. 值存儲
- 10.5. UNION, CASE 和相關構造
- Chapter 11. 索引
- 11.1. 介紹
- 11.2. 索引類型
- 11.3. 多字段索引
- 11.4. 索引和ORDER BY
- 11.5. 組合多個索引
- 11.6. 唯一索引
- 11.7. 表達式上的索引
- 11.8. 部分索引
- 11.9. 操作符類和操作符族
- 11.10. 索引和排序
- 11.11. 檢查索引的使用
- Chapter 12. 全文檢索
- 12.1. 介紹
- 12.2. 表和索引
- 12.3. 控制文本搜索
- 12.4. 附加功能
- 12.5. 解析器
- 12.6. 詞典
- 12.7. 配置實例
- 12.8. 測試和調試文本搜索
- 12.9. GiST和GIN索引類型
- 12.10. psql支持
- 12.11. 限制
- 12.12. 來自8.3之前文本搜索的遷移
- Chapter 13. 并發控制
- 13.1. 介紹
- 13.2. 事務隔離
- 13.3. 明確鎖定
- 13.4. 應用層數據完整性檢查
- 13.5. 鎖和索引
- Chapter 14. 性能提升技巧
- 14.1. 使用EXPLAIN
- 14.2. 規劃器使用的統計信息
- 14.3. 用明確的JOIN控制規劃器
- 14.4. 向數據庫中添加記錄
- 14.5. 非持久性設置
- III. 服務器管理
- Chapter 15. 源碼安裝
- 15.1. 簡版
- 15.2. 要求
- 15.3. 獲取源碼
- 15.4. 安裝過程
- 15.5. 安裝后設置
- 15.6. 支持平臺
- 15.7. 特定平臺注意事項
- Chapter 16. Windows下用源代碼安裝
- 16.1. 用Visual C++或Microsoft Windows SDK編譯
- 16.2. 用Visual C++或 Borland C++編譯 libpq
- Chapter 17. 服務器設置和操作
- 17.1. PostgreSQL用戶賬戶
- 17.2. 創建數據庫集群
- 17.3. 啟動數據庫服務器
- 17.4. 管理內核資源
- 17.5. 關閉服務器
- 17.6. 升級一個 PostgreSQL 集群
- 17.7. 防止服務器欺騙
- 17.8. 加密選項
- 17.9. 用 SSL 進行安全的 TCP/IP 連接
- 17.10. 用SSH隧道進行安全 TCP/IP 連接
- 17.11. 在Windows上注冊事件日志
- Chapter 18. 服務器配置
- 18.1. 設置參數
- 18.2. 文件位置
- 18.3. 連接和認證
- 18.4. 資源消耗
- 18.5. 預寫式日志
- 18.6. 復制
- 18.7. 查詢規劃
- 18.8. 錯誤報告和日志
- 18.9. 運行時統計
- 18.10. 自動清理
- 18.11. 客戶端連接缺省
- 18.12. 鎖管理
- 18.13. 版本和平臺兼容性
- 18.14. Error Handling
- 18.15. 預置選項
- 18.16. 自定義選項
- 18.17. 開發人員選項
- 18.18. 短選項
- Chapter 19. 用戶認證
- 19.1. pg_hba.conf文件
- 19.2. 用戶名映射
- 19.3. 認證方法
- 19.4. 用戶認證
- Chapter 20. 數據庫角色
- 20.1. 數據庫角色
- 20.2. 角色屬性
- 20.3. 角色成員
- 20.4. 函數和觸發器安全
- Chapter 21. 管理數據庫
- 21.1. 概述
- 21.2. 創建一個數據庫
- 21.3. 模板數據庫
- 21.4. 數據庫配置
- 21.5. 刪除數據庫
- 21.6. 表空間
- Chapter 22. 區域
- 22.1. 區域支持
- 22.2. 排序規則支持
- 22.3. 字符集支持
- Chapter 23. 日常數據庫維護工作
- 23.1. 日常清理
- 23.2. 經常重建索引
- 23.3. 日志文件維護
- Chapter 24. 備份與恢復
- 24.1. SQL轉儲
- 24.2. 文件系統級別備份
- 24.3. 在線備份以及即時恢復(PITR)
- Chapter 25. 高可用性與負載均衡,復制
- 25.1. 不同解決方案的比較
- 25.2. 日志傳送備份服務器
- 25.3. 失效切換
- 25.4. 日志傳送的替代方法
- 25.5. 熱備
- Chapter 26. 恢復配置
- 26.1. 歸檔恢復設置
- 26.2. 恢復目標設置
- 26.3. 備用服務器設置
- Chapter 27. 監控數據庫的活動
- 27.1. 標準Unix工具
- 27.2. 統計收集器
- 27.3. 查看鎖
- 27.4. 動態跟蹤
- Chapter 28. 監控磁盤使用情況
- 28.1. 判斷磁盤的使用量
- 28.2. 磁盤滿導致的失效
- Chapter 29. 可靠性和預寫式日志
- 29.1. 可靠性
- 29.2. 預寫式日志(WAL)
- 29.3. 異步提交
- 29.4. WAL 配置
- 29.5. WAL 內部
- Chapter 30. 回歸測試
- 30.1. 運行測試
- 30.2. 測試評估
- 30.3. 平臺相關的比較文件
- 30.4. 測試覆蓋率檢查
- IV. 客戶端接口
- Chapter 31. libpq - C 庫
- 31.1. 數據庫連接控制函數
- 31.2. 連接狀態函數
- 31.3. 命令執行函數
- 31.4. 異步命令處理
- 31.5. 逐行檢索查詢結果
- 31.6. 取消正在處理的查詢
- 31.7. 捷徑接口
- 31.8. 異步通知
- 31.9. 與COPY命令相關的函數
- 31.10. 控制函數
- 31.11. 各種函數
- 31.12. 注意信息處理
- 31.13. 事件系統
- 31.14. 環境變量
- 31.15. 口令文件
- 31.16. 連接服務的文件
- 31.17. LDAP查找連接參數
- 31.18. SSL 支持
- 31.19. 在多線程程序里的行為
- 31.20. 制作libpq程序
- 31.21. 例子程序
- Chapter 32. 大對象
- 32.1. 介紹
- 32.2. 實現特點
- 32.3. 客戶端接口
- 32.4. 服務器端函數
- 32.5. 例子程序
- Chapter 33. ECPG - 在C中嵌入SQL
- 33.1. 概念
- 33.2. 管理數據庫連接
- 33.3. 運行SQL命令
- 33.4. 使用宿主變量
- 33.5. 動態SQL
- 33.6. pgtypes 庫
- 33.7. 使用描述符范圍
- 33.8. 錯誤處理
- 33.9. 預處理器指令
- 33.10. 處理嵌入的SQL程序
- 33.11. 庫函數
- 33.12. 大對象
- 33.13. C++應用程序
- 33.14. 嵌入的SQL命令
- ALLOCATE DESCRIPTOR
- CONNECT
- DEALLOCATE DESCRIPTOR
- DECLARE
- DESCRIBE
- DISCONNECT
- EXECUTE IMMEDIATE
- GET DESCRIPTOR
- OPEN
- PREPARE
- SET AUTOCOMMIT
- SET CONNECTION
- SET DESCRIPTOR
- TYPE
- VAR
- WHENEVER
- 33.15. Informix兼容模式
- 33.16. 內部
- Chapter 34. 信息模式
- 34.1. 關于這個模式
- 34.2. 數據類型
- 34.3. information_schema_catalog_name
- 34.4. administrable_role_authorizations
- 34.5. applicable_roles
- 34.6. attributes
- 34.7. character_sets
- 34.8. check_constraint_routine_usage
- 34.9. check_constraints
- 34.10. collations
- 34.11. collation_character_set_applicability
- 34.12. column_domain_usage
- 34.13. column_options
- 34.14. column_privileges
- 34.15. column_udt_usage
- 34.16. columns
- 34.17. constraint_column_usage
- 34.18. constraint_table_usage
- 34.19. data_type_privileges
- 34.20. domain_constraints
- 34.21. domain_udt_usage
- 34.22. domains
- 34.23. element_types
- 34.24. enabled_roles
- 34.25. foreign_data_wrapper_options
- 34.26. foreign_data_wrappers
- 34.27. foreign_server_options
- 34.28. foreign_servers
- 34.29. foreign_table_options
- 34.30. foreign_tables
- 34.31. key_column_usage
- 34.32. parameters
- 34.33. referential_constraints
- 34.34. role_column_grants
- 34.35. role_routine_grants
- 34.36. role_table_grants
- 34.37. role_udt_grants
- 34.38. role_usage_grants
- 34.39. routine_privileges
- 34.40. routines
- 34.41. schemata
- 34.42. sequences
- 34.43. sql_features
- 34.44. sql_implementation_info
- 34.45. sql_languages
- 34.46. sql_packages
- 34.47. sql_parts
- 34.48. sql_sizing
- 34.49. sql_sizing_profiles
- 34.50. table_constraints
- 34.51. table_privileges
- 34.52. tables
- 34.53. triggered_update_columns
- 34.54. triggers
- 34.55. udt_privileges
- 34.56. usage_privileges
- 34.57. user_defined_types
- 34.58. user_mapping_options
- 34.59. user_mappings
- 34.60. view_column_usage
- 34.61. view_routine_usage
- 34.62. view_table_usage
- 34.63. views
- V. 服務器端編程
- Chapter 35. 擴展SQL
- 35.1. 擴展性是如何實現的
- 35.2. PostgreSQL類型系統
- 35.3. 用戶定義的函數
- 35.4. 查詢語言(SQL)函數
- 35.5. 函數重載
- 35.6. 函數易失性范疇
- 35.7. 過程語言函數
- 35.8. 內部函數
- 35.9. C-語言函數
- 35.10. 用戶定義聚集
- 35.11. 用戶定義類型
- 35.12. 用戶定義操作符
- 35.13. 操作符優化信息
- 35.14. 擴展索引接口
- 35.15. 包裝相關對象到一個擴展
- 35.16. 擴展基礎設施建設
- Chapter 36. 觸發器
- 36.1. 觸發器行為概述
- 36.2. 數據改變的可視性
- 36.3. 用C寫觸發器
- 36.4. 一個完整的觸發器例子
- Chapter 37. 事件觸發器
- 37.1. 事件觸發器行為的概述
- 37.2. 事件觸發器觸發矩陣
- 37.3. 用C編寫事件觸發器函數
- 37.4. 一個完整的事件觸發器的例子
- Chapter 38. 規則系統
- 38.1. 查詢樹
- 38.2. 視圖和規則系統
- 38.3. 物化視圖
- 38.4. 在 INSERT, UPDATE, 和 DELETE上的規則
- 38.5. 規則和權限
- 38.6. 規則和命令狀態
- 38.7. 規則與觸發器的比較
- Chapter 39. 過程語言
- 39.1. 安裝過程語言
- Chapter 40. PL/pgSQL - SQL過程語言
- 40.1. 概述
- 40.2. PL/pgSQL的結構
- 40.3. 聲明
- 40.4. 表達式
- 40.5. 基本語句
- 40.6. 控制結構
- 40.7. 游標
- 40.8. 錯誤和消息
- 40.9. 觸發器過程
- 40.10. 在后臺下的PL/pgSQL
- 40.11. 開發PL/pgSQL的一些提示
- 40.12. 從Oracle PL/SQL進行移植
- Chapter 41. PL/Tcl - Tcl 過程語言
- 41.1. 概述
- 41.2. PL/Tcl 函數和參數
- 41.3. PL/Tcl里的數據值
- 41.4. PL/Tcl里的全局量
- 41.5. 在PL/Tcl里訪問數據庫
- 41.6. PL/Tcl里的觸發器過程
- 41.7. 模塊和unknown的命令
- 41.8. Tcl 過程名字
- Chapter 42. PL/Perl - Perl 過程語言
- 42.1. PL/Perl 函數和參數
- 42.2. PL/Perl里的數據值
- 42.3. 內置函數
- 42.4. PL/Perl里的全局變量
- 42.5. 可信的和不可信的 PL/Perl
- 42.6. PL/Perl 觸發器
- 42.7. 后臺PL/Perl
- Chapter 43. PL/Python - Python 過程語言
- 43.1. Python 2 vs. Python 3
- 43.2. PL/Python Functions
- 43.3. Data Values
- 43.4. Sharing Data
- 43.5. Anonymous Code Blocks
- 43.6. Trigger Functions
- 43.7. Database Access
- 43.8. Explicit Subtransactions
- 43.9. Utility Functions
- 43.10. Environment Variables
- Chapter 44. 服務器編程接口
- 44.1. 接口函數
- SPI_connect
- SPI_finish
- SPI_push
- SPI_pop
- SPI_execute
- SPI_exec
- SPI_execute_with_args
- SPI_prepare
- SPI_prepare_cursor
- SPI_prepare_params
- SPI_getargcount
- SPI_getargtypeid
- SPI_is_cursor_plan
- SPI_execute_plan
- SPI_execute_plan_with_paramlist
- SPI_execp
- SPI_cursor_open
- SPI_cursor_open_with_args
- SPI_cursor_open_with_paramlist
- SPI_cursor_find
- SPI_cursor_fetch
- SPI_cursor_move
- SPI_scroll_cursor_fetch
- SPI_scroll_cursor_move
- SPI_cursor_close
- SPI_keepplan
- SPI_saveplan
- 44.2. 接口支持函數
- SPI_fname
- SPI_fnumber
- SPI_getvalue
- SPI_getbinval
- SPI_gettype
- SPI_gettypeid
- SPI_getrelname
- SPI_getnspname
- 44.3. 內存管理
- SPI_palloc
- SPI_repalloc
- SPI_pfree
- SPI_copytuple
- SPI_returntuple
- SPI_modifytuple
- SPI_freetuple
- SPI_freetuptable
- SPI_freeplan
- 44.4. 數據改變的可視性
- 44.5. 例子
- Chapter 45. 后臺工作進程
- VI. 參考手冊
- I. SQL 命令
- ABORT
- ALTER AGGREGATE
- ALTER COLLATION
- ALTER CONVERSION
- ALTER DATABASE
- ALTER DEFAULT PRIVILEGES
- ALTER DOMAIN
- ALTER EXTENSION
- ALTER EVENT TRIGGER
- ALTER FOREIGN DATA WRAPPER
- ALTER FOREIGN TABLE
- ALTER FUNCTION
- ALTER GROUP
- ALTER INDEX
- ALTER LANGUAGE
- ALTER LARGE OBJECT
- ALTER MATERIALIZED VIEW
- ALTER OPERATOR
- ALTER OPERATOR CLASS
- ALTER OPERATOR FAMILY
- ALTER ROLE
- ALTER RULE
- ALTER SCHEMA
- ALTER SEQUENCE
- ALTER SERVER
- ALTER TABLE
- ALTER TABLESPACE
- ALTER TEXT SEARCH CONFIGURATION
- ALTER TEXT SEARCH DICTIONARY
- ALTER TEXT SEARCH PARSER
- ALTER TEXT SEARCH TEMPLATE
- ALTER TRIGGER
- ALTER TYPE
- ALTER USER
- ALTER USER MAPPING
- ALTER VIEW
- ANALYZE
- BEGIN
- CHECKPOINT
- CLOSE
- CLUSTER
- COMMENT
- COMMIT
- COMMIT PREPARED
- COPY
- CREATE AGGREGATE
- CREATE CAST
- CREATE COLLATION
- CREATE CONVERSION
- CREATE DATABASE
- CREATE DOMAIN
- CREATE EXTENSION
- CREATE EVENT TRIGGER
- CREATE FOREIGN DATA WRAPPER
- CREATE FOREIGN TABLE
- CREATE FUNCTION
- CREATE GROUP
- CREATE INDEX
- CREATE LANGUAGE
- CREATE MATERIALIZED VIEW
- CREATE OPERATOR
- CREATE OPERATOR CLASS
- CREATE OPERATOR FAMILY
- CREATE ROLE
- CREATE RULE
- CREATE SCHEMA
- CREATE SEQUENCE
- CREATE SERVER
- CREATE TABLE
- CREATE TABLE AS
- CREATE TABLESPACE
- CREATE TEXT SEARCH CONFIGURATION
- CREATE TEXT SEARCH DICTIONARY
- CREATE TEXT SEARCH PARSER
- CREATE TEXT SEARCH TEMPLATE
- CREATE TRIGGER
- CREATE TYPE
- CREATE USER
- CREATE USER MAPPING
- CREATE VIEW
- DEALLOCATE
- DECLARE
- DELETE
- DISCARD
- DO
- DROP AGGREGATE
- DROP CAST
- DROP COLLATION
- DROP CONVERSION
- DROP DATABASE
- DROP DOMAIN
- DROP EXTENSION
- DROP EVENT TRIGGER
- DROP FOREIGN DATA WRAPPER
- DROP FOREIGN TABLE
- DROP FUNCTION
- DROP GROUP
- DROP INDEX
- DROP LANGUAGE
- DROP MATERIALIZED VIEW
- DROP OPERATOR
- DROP OPERATOR CLASS
- DROP OPERATOR FAMILY
- DROP OWNED
- DROP ROLE
- DROP RULE
- DROP SCHEMA
- DROP SEQUENCE
- DROP SERVER
- DROP TABLE
- DROP TABLESPACE
- DROP TEXT SEARCH CONFIGURATION
- DROP TEXT SEARCH DICTIONARY
- DROP TEXT SEARCH PARSER
- DROP TEXT SEARCH TEMPLATE
- DROP TRIGGER
- DROP TYPE
- DROP USER
- DROP USER MAPPING
- DROP VIEW
- END
- EXECUTE
- EXPLAIN
- FETCH
- GRANT
- INSERT
- LISTEN
- LOAD
- LOCK
- MOVE
- NOTIFY
- PREPARE
- PREPARE TRANSACTION
- REASSIGN OWNED
- REFRESH MATERIALIZED VIEW
- REINDEX
- RELEASE SAVEPOINT
- RESET
- REVOKE
- ROLLBACK
- ROLLBACK PREPARED
- ROLLBACK TO SAVEPOINT
- SAVEPOINT
- SECURITY LABEL
- SELECT
- SELECT INTO
- SET
- SET CONSTRAINTS
- SET ROLE
- SET SESSION AUTHORIZATION
- SET TRANSACTION
- SHOW
- START TRANSACTION
- TRUNCATE
- UNLISTEN
- UPDATE
- VACUUM
- VALUES
- II. PostgreSQL 客戶端應用程序
- clusterdb
- createdb
- createlang
- createuser
- dropdb
- droplang
- dropuser
- ecpg
- pg_basebackup
- pg_config
- pg_dump
- pg_dumpall
- pg_isready
- pg_receivexlog
- pg_restore
- psql
- reindexdb
- vacuumdb
- III. PostgreSQL 服務器應用程序
- initdb
- pg_controldata
- pg_ctl
- pg_resetxlog
- postgres
- postmaster
- VII. 內部
- Chapter 46. PostgreSQL內部概述
- 46.1. 查詢經過的路徑
- 46.2. 連接是如何建立起來的
- 46.3. 分析器階段
- 46.4. PostgreSQL規則系統
- 46.5. 規劃器/優化器
- 46.6. 執行器
- Chapter 47. 系統表
- 47.1. 概述
- 47.2. pg_aggregate
- 47.3. pg_am
- 47.4. pg_amop
- 47.5. pg_amproc
- 47.6. pg_attrdef
- 47.7. pg_attribute
- 47.8. pg_authid
- 47.9. pg_auth_members
- 47.10. pg_cast
- 47.11. pg_class
- 47.12. pg_event_trigger
- 47.13. pg_constraint
- 47.14. pg_collation
- 47.15. pg_conversion
- 47.16. pg_database
- 47.17. pg_db_role_setting
- 47.18. pg_default_acl
- 47.19. pg_depend
- 47.20. pg_description
- 47.21. pg_enum
- 47.22. pg_extension
- 47.23. pg_foreign_data_wrapper
- 47.24. pg_foreign_server
- 47.25. pg_foreign_table
- 47.26. pg_index
- 47.27. pg_inherits
- 47.28. pg_language
- 47.29. pg_largeobject
- 47.30. pg_largeobject_metadata
- 47.31. pg_namespace
- 47.32. pg_opclass
- 47.33. pg_operator
- 47.34. pg_opfamily
- 47.35. pg_pltemplate
- 47.36. pg_proc
- 47.37. pg_range
- 47.38. pg_rewrite
- 47.39. pg_seclabel
- 47.40. pg_shdepend
- 47.41. pg_shdescription
- 47.42. pg_shseclabel
- 47.43. pg_statistic
- 47.44. pg_tablespace
- 47.45. pg_trigger
- 47.46. pg_ts_config
- 47.47. pg_ts_config_map
- 47.48. pg_ts_dict
- 47.49. pg_ts_parser
- 47.50. pg_ts_template
- 47.51. pg_type
- 47.52. pg_user_mapping
- 47.53. 系統視圖
- 47.54. pg_available_extensions
- 47.55. pg_available_extension_versions
- 47.56. pg_cursors
- 47.57. pg_group
- 47.58. pg_indexes
- 47.59. pg_locks
- 47.60. pg_matviews
- 47.61. pg_prepared_statements
- 47.62. pg_prepared_xacts
- 47.63. pg_roles
- 47.64. pg_rules
- 47.65. pg_seclabels
- 47.66. pg_settings
- 47.67. pg_shadow
- 47.68. pg_stats
- 47.69. pg_tables
- 47.70. pg_timezone_abbrevs
- 47.71. pg_timezone_names
- 47.72. pg_user
- 47.73. pg_user_mappings
- 47.74. pg_views
- Chapter 48. 前/后端協議
- 48.1. 概要
- 48.2. 消息流
- 48.3. 流復制協議
- 48.4. 消息數據類型
- 48.5. 消息格式
- 48.6. 錯誤和通知消息字段
- 48.7. 自協議 2.0 以來的變化的概述
- Chapter 49. PostgreSQL 編碼約定
- 49.1. 格式
- 49.2. 報告服務器里的錯誤
- 49.3. 錯誤消息風格指導
- Chapter 50. 本地語言支持
- 50.1. 寄語翻譯家
- 50.2. 寄語程序員
- Chapter 51. 書寫一個過程語言處理器
- Chapter 52. 寫一個外數據包
- 52.1. 外數據封裝函數
- 52.2. 外數據封裝回調程序
- 52.3. 外數據封裝輔助函數
- 52.4. 外數據封裝查詢規劃
- Chapter 53. 基因查詢優化器
- 53.1. 作為復雜優化問題的查詢處理
- 53.2. 基因算法
- 53.3. PostgreSQL 里的基因查詢優化(GEQO)
- 53.4. 進一步閱讀
- Chapter 54. 索引訪問方法接口定義
- 54.1. 索引的系統表記錄
- 54.2. 索引訪問方法函數
- 54.3. 索引掃描
- 54.4. 索引鎖的考量
- 54.5. 索引唯一性檢查
- 54.6. 索引開銷估計函數
- Chapter 55. GiST索引
- 55.1. 介紹
- 55.2. 擴展性
- 55.3. 實現
- 55.4. 例
- Chapter 56. SP-GiST索引
- 56.1. 介紹
- 56.2. 擴展性
- 56.3. 實現
- 56.4. 例
- Chapter 57. GIN索引
- 57.1. 介紹
- 57.2. 擴展性
- 57.3. 實現
- 57.4. GIN提示與技巧
- 57.5. 限制
- 57.6. 例子
- Chapter 58. 數據庫物理存儲
- 58.1. 數據庫文件布局
- 58.2. TOAST
- 58.3. 自由空間映射
- 58.4. 可見映射
- 58.5. 初始化分支
- 58.6. 數據庫分頁文件
- Chapter 59. BKI后端接口
- 59.1. BKI 文件格式
- 59.2. BKI 命令
- 59.3. 系統初始化的BKI文件的結構
- 59.4. 例子
- Chapter 60. 規劃器如何使用統計信息
- 60.1. 行預期的例子
- VIII. 附錄
- Appendix A. PostgreSQL 錯誤代碼
- Appendix B. 日期/時間支持
- B.1. 日期/時間輸入解析
- B.2. 日期/時間關鍵字
- B.3. 日期/時間配置文件
- B.4. 單位歷史
- Appendix C. SQL關鍵字
- Appendix D. SQL兼容性
- D.1. 支持的特性
- D.2. 不支持的特性
- Appendix E. 版本說明
- E.1. 版本 9.3.1
- E.2. 版本 9.3
- E.3. 版本9.2.5
- E.4. 版本9.2.4
- E.5. 版本9.2.3
- E.6. 版本9.2.2
- E.7. 版本9.2.1
- E.8. 版本9.2
- E.9. 發布9.1.10
- E.10. 發布9.1.9
- E.11. 發布9.1.8
- E.12. 發布9.1.7
- E.13. 發布9.1.6
- E.14. 發布9.1.5
- E.15. 發布9.1.4
- E.16. 發布9.1.3
- E.17. 發布9.1.2
- E.18. 發布9.1.1
- E.19. 發布9.1
- E.20. 版本 9.0.14
- E.21. 版本 9.0.13
- E.22. 版本 9.0.12
- E.23. 版本 9.0.11
- E.24. 版本 9.0.10
- E.25. 版本 9.0.9
- E.26. 版本 9.0.8
- E.27. 版本 9.0.7
- E.28. 版本 9.0.6
- E.29. 版本 9.0.5
- E.30. 版本 9.0.4
- E.31. 版本 9.0.3
- E.32. 版本 9.0.2
- E.33. 版本 9.0.1
- E.34. 版本 9.0
- E.35. 發布8.4.18
- E.36. 發布8.4.17
- E.37. 發布8.4.16
- E.38. 發布8.4.15
- E.39. 發布8.4.14
- E.40. 發布8.4.13
- E.41. 發布8.4.12
- E.42. 發布8.4.11
- E.43. 發布8.4.10
- E.44. 發布8.4.9
- E.45. 發布8.4.8
- E.46. 發布8.4.7
- E.47. 發布8.4.6
- E.48. 發布8.4.5
- E.49. 發布8.4.4
- E.50. 發布8.4.3
- E.51. 發布8.4.2
- E.52. 發布8.4.1
- E.53. 發布8.4
- E.54. 發布8.3.23
- E.55. 發布8.3.22
- E.56. 發布8.3.21
- E.57. 發布8.3.20
- E.58. 發布8.3.19
- E.59. 發布8.3.18
- E.60. 發布8.3.17
- E.61. 發布8.3.16
- E.62. 發布8.3.15
- E.63. 發布8.3.14
- E.64. 發布8.3.13
- E.65. 發布8.3.12
- E.66. 發布8.3.11
- E.67. 發布8.3.10
- E.68. 發布8.3.9
- E.69. 發布8.3.8
- E.70. 發布8.3.7
- E.71. 發布8.3.6
- E.72. 發布8.3.5
- E.73. 發布8.3.4
- E.74. 發布8.3.3
- E.75. 發布8.3.2
- E.76. 發布8.3.1
- E.77. 發布8.3
- E.78. 版本 8.2.23
- E.79. 版本 8.2.22
- E.80. 版本 8.2.21
- E.81. 版本 8.2.20
- E.82. 版本 8.2.19
- E.83. 版本 8.2.18
- E.84. 版本 8.2.17
- E.85. 版本 8.2.16
- E.86. 版本 8.2.15
- E.87. 版本 8.2.14
- E.88. 版本 8.2.13
- E.89. 版本 8.2.12
- E.90. 版本 8.2.11
- E.91. 版本 8.2.10
- E.92. 版本 8.2.9
- E.93. 版本 8.2.8
- E.94. 版本 8.2.7
- E.95. 版本 8.2.6
- E.96. 版本 8.2.5
- E.97. 版本 8.2.4
- E.98. 版本 8.2.3
- E.99. 版本 8.2.2
- E.100. 版本 8.2.1
- E.101. 版本 8.2
- E.102. 版本 8.1.23
- E.103. 版本 8.1.22
- E.104. 版本 8.1.21
- E.105. 版本 8.1.20
- E.106. 版本 8.1.19
- E.107. 版本 8.1.18
- E.108. 版本 8.1.17
- E.109. 版本 8.1.16
- E.110. 版本 8.1.5
- E.111. 版本 8.1.14
- E.112. 版本 8.1.13
- E.113. 版本 8.1.12
- E.114. 版本 8.1.11
- E.115. 版本 8.1.10
- E.116. 版本 8.1.9
- E.117. 版本 8.1.8
- E.118. 版本 8.1.7
- E.119. 版本 8.1.6
- E.120. 版本 8.1.5
- E.121. 版本 8.1.4
- E.122. 版本 8.1.3
- E.123. 版本 8.1.2
- E.124. 版本 8.1.1
- E.125. 版本 8.1
- E.126. 版本 8.0.26
- E.127. 版本 8.0.25
- E.128. 版本 8.0.24
- E.129. 版本 8.0.23
- E.130. 版本 8.0.22
- E.131. 版本 8.0.21
- E.132. 版本 8.0.20
- E.133. 版本 8.0.19
- E.134. 版本 8.0.18
- E.135. 版本 8.0.17
- E.136. 版本 8.0.16
- E.137. 版本 8.0.15
- E.138. 版本 8.0.14
- E.139. 版本 8.0.13
- E.140. 版本 8.0.12
- E.141. 版本 8.0.11
- E.142. 版本 8.0.10
- E.143. 版本 8.0.9
- E.144. 版本 8.0.8
- E.145. 版本 8.0.7
- E.146. 版本 8.0.6
- E.147. 版本 8.0.5
- E.148. 版本 8.0.4
- E.149. 版本 8.0.3
- E.150. 版本 8.0.2
- E.151. 版本 8.0.1
- E.152. 版本 8.0.0
- E.153. 版本 7.4.30
- E.154. 版本 7.4.29
- E.155. 版本 7.4.28
- E.156. 版本 7.4.27
- E.157. 版本 7.4.26
- E.158. 版本 7.4.25
- E.159. 版本 7.4.24
- E.160. 版本 7.4.23
- E.161. 版本 7.4.22
- E.162. 版本 7.4.21
- E.163. 版本 7.4.20
- E.164. 版本 7.4.19
- E.165. 版本 7.4.18
- E.166. 版本 7.4.17
- E.167. 版本 7.4.16
- E.168. 版本 7.4.15
- E.169. 版本 7.4.14
- E.170. 版本 7.4.13
- E.171. 版本 7.4.12
- E.172. 版本 7.4.11
- E.173. 版本 7.4.10
- E.174. 版本 7.4.9
- E.175. 版本 7.4.8
- E.176. 版本 7.4.7
- E.177. 版本 7.4.6
- E.178. 版本 7.4.3
- E.179. 版本 7.4.4
- E.180. 版本 7.4.3
- E.181. 版本 7.4.2
- E.182. 版本 7.4.1
- E.183. 版本 7.4
- E.184. 版本 7.3.21
- E.185. 版本 7.3.20
- E.186. 版本 7.3.19
- E.187. 版本 7.3.18
- E.188. 版本 7.3.17
- E.189. 版本 7.3.16
- E.190. 版本 7.3.15
- E.191. 版本 7.3.14
- E.192. 版本 7.3.13
- E.193. 版本 7.3.12
- E.194. 版本 7.3.11
- E.195. 版本 7.3.10
- E.196. 版本 7.3.9
- E.197. 版本 7.3.8
- E.198. 版本 7.3.7
- E.199. 版本 7.3.6
- E.200. 版本 7.3.5
- E.201. 版本 7.3.4
- E.202. 版本 7.3.3
- E.203. 版本 7.3.2
- E.204. 版本 7.3.1
- E.205. 版本 7.3
- E.206. 版本 7.2.8
- E.207. 版本 7.2.7
- E.208. 版本 7.2.6
- E.209. 版本 7.2.5
- E.210. 版本 7.2.4
- E.211. 版本 7.2.3
- E.212. 版本 7.2.2
- E.213. 版本 7.2.1
- E.214. 版本 7.2
- E.215. 版本 7.1.3
- E.216. 版本 7.1.2
- E.217. 版本 7.1.1
- E.218. 版本 7.1
- E.219. 版本 7.0.3
- E.220. 版本 7.0.2
- E.221. 版本 7.0.1
- E.222. 版本 7.0
- E.223. 版本 6.5.3
- E.224. 版本 6.5.2
- E.225. 版本 6.5.1
- E.226. 版本 6.5
- E.227. 版本 6.4.2
- E.228. 版本 6.4.1
- E.229. 版本 6.4
- E.230. 版本 6.3.2
- E.231. 版本 6.3.1
- E.232. 版本 6.3
- E.233. 版本 6.2.1
- E.234. 版本 6.2
- E.235. 版本 6.1.1
- E.236. 版本 6.1
- E.237. 版本 6.0
- E.238. 版本 1.09
- E.239. 版本 1.02
- E.240. 版本 1.01
- E.241. 版本 1.0
- E.242. Postgres95 版本 0.03
- E.243. Postgres95 版本 0.02
- E.244. Postgres95 版本 0.01
- Appendix F. 額外提供的模塊
- F.1. adminpack
- F.2. auth_delay
- F.3. auto_explain
- F.4. btree_gin
- F.5. btree_gist
- F.6. chkpass
- F.7. citext
- F.8. cube
- F.9. dblink
- dblink_connect
- dblink_connect_u
- dblink_disconnect
- dblink
- dblink_exec
- dblink_open
- dblink_fetch
- dblink_close
- dblink_get_connections
- dblink_error_message
- dblink_send_query
- dblink_is_busy
- dblink_get_notify
- dblink_get_result
- dblink_cancel_query
- dblink_get_pkey
- dblink_build_sql_insert
- dblink_build_sql_delete
- dblink_build_sql_update
- F.10. dict_int
- F.11. dict_xsyn
- F.12. dummy_seclabel
- F.13. earthdistance
- F.14. file_fdw
- F.15. fuzzystrmatch
- F.16. hstore
- F.17. intagg
- F.18. intarray
- F.19. isn
- F.20. lo
- F.21. ltree
- F.22. pageinspect
- F.23. passwordcheck
- F.24. pg_buffercache
- F.25. pgcrypto
- F.26. pg_freespacemap
- F.27. pgrowlocks
- F.28. pg_stat_statements
- F.29. pgstattuple
- F.30. pg_trgm
- F.31. postgres_fdw
- F.32. seg
- F.33. sepgsql
- F.34. spi
- F.35. sslinfo
- F.36. tablefunc
- F.37. tcn
- F.38. test_parser
- F.39. tsearch2
- F.40. unaccent
- F.41. uuid-ossp
- F.42. xml2
- Appendix G. 額外提供的程序
- G.1. 客戶端應用程序
- oid2name
- pgbench
- vacuumlo
- G.2. 服務器端應用程序
- pg_archivecleanup
- pg_standby
- pg_test_fsync
- pg_test_timing
- pg_upgrade
- pg_xlogdump
- Appendix H. 外部項目
- H.1. 客戶端接口
- H.2. 管理工具
- H.3. 過程語言
- H.4. 擴展
- Appendix I. 源代碼庫
- I.1. 獲得源代碼通過Git
- Appendix J. 文檔
- J.1. DocBook
- J.2. 工具集
- J.3. 制作文檔
- J.4. 文檔寫作
- J.5. 風格指導
- Appendix K. 首字母縮略詞
- 參考書目
- Index