0
A
回答
1
每行的內部「地址」存儲在系統列ctid
(與Oracle的rowid
非常相似)。此ctid值存儲在索引中。
更多細節都在手冊中:
- https://www.postgresql.org/docs/current/static/ddl-system-columns.html
- https://www.postgresql.org/docs/current/static/storage-page-layout.html#HEAPTUPLEHEADERDATA-TABLE
您可以選擇列,如果你想:
select ctid, t.*
from your_table t;
相關問題
- 1. 使用Rails/Postgresql索引多列索引
- 2. PostgreSQL索引運行時間
- 3. PostgreSQL索引使用分析
- 4. Postgresql索引未使用
- 5. 索引PostgreSQL Hstore Keys
- 6. PostgreSQL裏的索引
- 7. Postgresql併發索引
- 8. PostgreSQL索引優化
- 9. 如何按行索引和列索引
- 10. Postgresql部分索引超過最大索引行大小
- 11. 如何在PostgreSQL 9.6中刪除索引?
- 12. 模數分表,如何索引? PostgreSQL的
- 13. postgresql:如何列表索引列?
- 14. 如何預測PostgreSQL索引大小
- 15. PostgreSQL:如何索引所有外鍵?
- 16. 使用PostgreSQL中的約束對ORDER BY使用的索引進行索引
- 17. 如何應用索引進行搜索
- 18. 爲什麼不使用PostgreSQL索引並建議索引
- 19. postgreSQL中的索引維護
- 20. postgresql索引字符串列
- 21. PostgreSQL的索引JSONB陣列
- 22. Postgresql索引範圍類型
- 23. PostgreSQL索引物理佈局
- 24. postgresql - pk與唯一索引
- 25. JSON上的PostgreSQL索引
- 26. PostgreSQL索引創建時間
- 27. PostgreSQL索引性能問題
- 28. PostgreSQL時間戳 - 索引
- 29. PostgreSQL唯一索引錯誤
- 30. 如何使用Apache索引對文件系統進行索引
所以任何更新的行會需要索引更新,因爲ctid會改變,對嗎? – IamIC
@IamIC:僅當更新更改索引列時。如果沒有,Postgres可以使用「HOT」(堆專用元組)更新:https://github.com/postgres/postgres/blob/master/src/backend/access/heap/README.HOT另請參閱[this答案](https://dba.stackexchange.com/a/84859/1822)和[這篇Postgres wiki文章](https://wiki.postgresql.org/wiki/Index-only_scans#Interaction_with_HOT) –