Consider the following plan:
Index Scan using foo_c1_idx1 on foo (cost=0.00..8.38 rows=1 width=37) (actual time=0.012..0.013 rows=1 loops=1) Index Cond: (c1 = 500) Buffers: shared hit=4 Total runtime: 0.036 ms
As we can see, the cost to get all rows is
8.38. On my system
So, as long as the index scan
includes 2 random page reading (The first one is to read an index, and the second one to read the actual table), it's not clear what the
0.38 means in the plan?
Could you explain how it's computed?