> [!NOTE] Tid Scan > <table> > <tr> > <td width="25%"><img src="assets/ex_tidscan.png"></td> > <td>The fastest possible scan. It fetches a row directly by its physical location (Block number and Offset). This is used when the query explicitly specifies the <code>ctid</code> system column, bypassing indexes and sequential scans entirely.</td> > </tr> > </table> > > ```sql > -- Fetching a tuple directly by its block and offset > EXPLAIN (ANALYZE, COSTS, BUFFERS, VERBOSE) > SELECT * FROM animals WHERE ctid = '(0,1)'; > ``` > > ![TidScan Plan Tree](assets/plan_tree_op_tid_scan.svg) > > ```text > Tid Scan on public.animals (cost=0.00..4.01 rows=1 width=27) (actual time=0.002..0.003 rows=1 loops=1) > Output: id, name, species_id, created_at > TID Cond: (animals.ctid = '(0,1)'::tid) > Buffers: shared hit=1 > Planning: > Buffers: shared hit=81 > Planning Time: 0.165 ms > Execution Time: 0.016 ms > ``` > > ![Tid Scan measured plan performance signature](assets/trace_op_tid_scan.svg) > > <table> > <tr> > <td rowspan="2" width="25%"><img src="assets/ex_tid_scan.svg"></td> > <td><b>Performance</b></td><td>The highest performance possible for a single-row lookup; bypasses the index entirely to perform a single-page read.</td> > </tr> > <tr><td><b>Cost</b></td><td><code>cpu_tuple_cost * number of tuple IDs</code></td></tr> > </table>