Giriş
Bu sütun her tabloda vardır. Oracle'daki ROWID gibidir. Bu sayı sabit değildir ve vacuum gibi işlemler sonunda değişebilir. Açıklaması şöyle.
Örnek
Şöyle yaparız.
Bu sütun her tabloda vardır. Oracle'daki ROWID gibidir. Bu sayı sabit değildir ve vacuum gibi işlemler sonunda değişebilir. Açıklaması şöyle.
Rowid and ctid are physical row/tuple identifiers => can change after rebuild/vacuum.
Açıklaması şöyle
Every row carries a few invisible columns: xmin (the transaction that created this version), xmax (the transaction that killed it), and ctid (the exact physical address, block and offset, where this version lives on disk).Run an UPDATE, and Postgres never touches the original row. It stamps xmax on the old version and inserts a brand new tuple with a fresh xmin and its own ctid. Query ctid before and after your UPDATE and you'll watch the address change - that's the new tuple, sitting somewhere else entirely. The old row is still there at its old ctid, just invisible to anyone whose snapshot no longer includes it.
Şöyle yaparız.
SELECT MAX(CTID) FROM YOUR_TABLE;
Hiç yorum yok:
Yorum Gönder