PostgreSQL �̎��s�v��� Tid Scan

PostgreSQL �ɂ� ORACLE �� ROWID �̂悤�� �s��f�����w�肷�邽�߂̗� ctid ������܂��B

db=# SELECT ctid, * FROM test.table1;

   ctid   |   f1  |      f2
----------+-------+---------------
 (0,1)    | A143H | test@test.com
 (0,2)    | A393G | test@test.com
 (0,3)    | A380E | test@test.com
 (0,4)    | A147K | test@test.com

ctid �́A�s�o�[�W�����̕����I�ʒu�Ȃ̂� �s���X�V������AVACUUM FULL �ŕς���Ă��܂��܂��B

�����A���� ctid ���g�p����Ƃ��Ȃ葁���s���擾�ł��܂��B ���̂Ƃ��̎��s�v��ɏo�Ă��鉉�Z�q�� Tid Scan �Ȃ̂ł��B

���ۂɎ��s�v����擾���Ă݂܂��B

db=# EXPLAIN
db-# SELECT * FROM test.table1 WHERE ctid = '(0,2)';

                         QUERY PLAN
------------------------------------------------------------
Tid Scan on table1  (cost=0.00..4.01 rows=1 width=218)
  TID Cond: (ctid = '(0,2)'::tid)

Tid Scan �Əo�܂����B

PRIMARY KEY �Ō��������ꍇ�̎��s�v����擾���Ă݂܂��B

db=# EXPLAIN
db-# SELECT * FROM test.table1 WHERE field1 = 1;

                                QUERY PLAN
---------------------------------------------------------------------------
 Index Scan using table1_pkey on table1  (cost=0.00..8.27 rows=1 width=50)
   Index Cond: ((field1)::text = '1'::text)

Index Scan ������� Tid Scan �̕����R�X�g���������ł��ˁB

Google �T�C�g������

Amazon�A�\�V�G�C�g