explain.depesz.com

PostgreSQL's explain analyze made readable

Result: O7v4

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 8,561.673 ↓ 27.0 27 1

Sort (cost=31.43..31.43 rows=1 width=16) (actual time=8,561.670..8,561.673 rows=27 loops=1)

  • Sort Key: objed_tank.created DESC
  • Sort Method: quicksort Memory: 26kB
2.          

Initplan (for Sort)

3. 0.171 8,199.593 ↑ 1.0 1 1

Aggregate (cost=14.98..14.99 rows=1 width=8) (actual time=8,199.592..8,199.593 rows=1 loops=1)

4. 6.466 8,199.422 ↓ 676.0 676 1

Nested Loop (cost=0.84..14.97 rows=1 width=8) (actual time=3,739.266..8,199.422 rows=676 loops=1)

  • Join Filter: (offer_2.task_id = (max(offer_3.task_id)))
  • Rows Removed by Join Filter: 24,636
5. 1.360 1.360 ↓ 3,164.0 3,164 1

Index Scan using offer_pkey on offer offer_2 (cost=0.42..7.47 rows=1 width=16) (actual time=0.022..1.360 rows=3,164 loops=1)

  • Index Cond: ((tyden = 42) AND (rok = 2,020) AND (kod_odb = 'A P1'::bpchar))
6. 5,280.716 8,191.596 ↓ 8.0 8 3,164

GroupAggregate (cost=0.42..7.48 rows=1 width=15) (actual time=0.039..2.589 rows=8 loops=3,164)

  • Group Key: offer_3.rok, offer_3.tyden, offer_3.kod_odb
7. 2,910.880 2,910.880 ↓ 4,492.0 4,492 3,164

Index Scan using offer_tyden_rok_kod_odb_idx on offer offer_3 (cost=0.42..7.46 rows=1 width=15) (actual time=0.006..0.920 rows=4,492 loops=3,164)

  • Index Cond: ((tyden = 42) AND (rok = 2,020))
8. 0.199 8,561.598 ↓ 27.0 27 1

Nested Loop (cost=0.84..16.43 rows=1 width=16) (actual time=8,354.745..8,561.598 rows=27 loops=1)

  • Join Filter: (offer.task_id = (max(offer_1.task_id)))
  • Rows Removed by Join Filter: 1,021
9. 13.202 8,234.947 ↓ 131.0 131 1

Nested Loop (cost=0.42..8.92 rows=1 width=24) (actual time=8,199.686..8,234.947 rows=131 loops=1)

  • Join Filter: ((objed_tank.tank)::text = (offer.tank)::text)
  • Rows Removed by Join Filter: 107,677
10. 1.385 1.385 ↓ 4,492.0 4,492 1

Index Scan using offer_pkey on offer (cost=0.42..7.46 rows=1 width=14) (actual time=0.046..1.385 rows=4,492 loops=1)

  • Index Cond: ((tyden = 42) AND (rok = 2,020))
11. 8,220.360 8,220.360 ↓ 3.0 24 4,492

Seq Scan on objed_tank (cost=0.00..1.36 rows=8 width=23) (actual time=1.826..1.830 rows=24 loops=4,492)

  • Filter: ((created > $0) AND ((kod_chov)::text = 'A P1'::text))
12. 210.255 326.452 ↓ 8.0 8 131

GroupAggregate (cost=0.42..7.48 rows=1 width=15) (actual time=0.038..2.492 rows=8 loops=131)

  • Group Key: offer_1.rok, offer_1.tyden, offer_1.kod_odb
13. 116.197 116.197 ↓ 4,492.0 4,492 131

Index Scan using offer_tyden_rok_kod_odb_idx on offer offer_1 (cost=0.42..7.46 rows=1 width=15) (actual time=0.006..0.887 rows=4,492 loops=131)

  • Index Cond: ((tyden = 42) AND (rok = 2,020))