explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IYcT : s

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.010 2.741 ↑ 1.0 50 1

Limit (cost=0.41..15.11 rows=50 width=542) (actual time=2.688..2.741 rows=50 loops=1)

2. 0.349 2.731 ↑ 9.0 50 1

WindowAgg (cost=0.41..132.10 rows=448 width=542) (actual time=2.688..2.731 rows=50 loops=1)

3. 0.651 2.382 ↑ 1.0 447 1

Unique (cost=0.41..122.02 rows=448 width=534) (actual time=0.042..2.382 rows=447 loops=1)

4. 0.507 1.731 ↓ 1.1 498 1

Nested Loop Left Join (cost=0.41..120.90 rows=448 width=534) (actual time=0.040..1.731 rows=498 loops=1)

  • Join Filter: (dad.lotnumber = dc.lotnumber)
  • Rows Removed by Join Filter: 944
5. 0.454 0.726 ↓ 1.1 498 1

Merge Left Join (cost=0.41..112.52 rows=448 width=532) (actual time=0.021..0.726 rows=498 loops=1)

  • Merge Cond: (dc.lotnumber = da.lotnumber)
6. 0.249 0.249 ↑ 1.0 447 1

Index Scan using pk_diamondsquery on diamond_query dc (cost=0.27..97.83 rows=448 width=532) (actual time=0.010..0.249 rows=447 loops=1)

7. 0.023 0.023 ↓ 1.0 54 1

Index Only Scan using diamond_account_data_pkey on diamond_account_data da (cost=0.14..12.92 rows=52 width=8) (actual time=0.006..0.023 rows=54 loops=1)

  • Heap Fetches: 54
8. 0.486 0.498 ↓ 2.0 2 498

Materialize (cost=0.00..1.65 rows=1 width=10) (actual time=0.000..0.001 rows=2 loops=498)

9. 0.012 0.012 ↓ 2.0 2 1

Seq Scan on diamond_account_data dad (cost=0.00..1.65 rows=1 width=10) (actual time=0.011..0.012 rows=2 loops=1)

  • Filter: (accountid = 638)
  • Rows Removed by Filter: 52