explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Jglv3

Settings
# exclusive inclusive rows x rows loops node
1. 0.049 1.408 ↓ 200.0 200 1

Nested Loop (cost=5.68..9,356,792.43 rows=1 width=212) (actual time=0.048..1.408 rows=200 loops=1)

2. 0.014 0.859 ↓ 100.0 100 1

Limit (cost=5.13..9,356,782.06 rows=1 width=37) (actual time=0.040..0.859 rows=100 loops=1)

3. 0.000 0.845 ↓ 100.0 100 1

Nested Loop (cost=5.13..9,356,782.06 rows=1 width=37) (actual time=0.039..0.845 rows=100 loops=1)

4. 0.045 0.045 ↑ 19,997.5 100 1

Index Only Scan Backward using sort_key_txn_passbook_idx on passbook p1 (cost=0.55..142,929.32 rows=1,999,751 width=37) (actual time=0.021..0.045 rows=100 loops=1)

  • Index Cond: ((player_id = 'jayant'::bpchar) AND (sort_key < 2000100))
  • Heap Fetches: 0
5. 0.100 0.800 ↑ 1.0 1 100

Subquery Scan on p2 (cost=4.58..4.60 rows=1 width=4) (actual time=0.007..0.008 rows=1 loops=100)

  • Filter: (p1.sort_key = p2.max_sort_key)
6. 0.000 0.700 ↑ 1.0 1 100

Result (cost=4.58..4.58 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=100)

7.          

Initplan (for Result)

8. 0.000 0.700 ↑ 1.0 1 100

Limit (cost=0.55..4.58 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=100)

9. 0.700 0.700 ↑ 2.0 1 100

Index Only Scan Backward using sort_key_passbook_idx on passbook (cost=0.55..8.60 rows=2 width=4) (actual time=0.006..0.007 rows=1 loops=100)

  • Index Cond: ((player_id = 'jayant'::bpchar) AND (txn_id = $0) AND (sort_key IS NOT NULL))
  • Heap Fetches: 0
10. 0.500 0.500 ↑ 1.0 2 100

Index Scan using sort_key_passbook_idx on passbook p4 (cost=0.55..10.34 rows=2 width=179) (actual time=0.004..0.005 rows=2 loops=100)

  • Index Cond: ((player_id = 'jayant'::bpchar) AND (txn_id = p1.txn_id))