explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 04U

Settings
# exclusive inclusive rows x rows loops node
1. 1.740 285,841.646 ↓ 0.0 0 1

Insert on metric_values (cost=8.96..9.00 rows=1 width=212) (actual time=285,841.646..285,841.646 rows=0 loops=1)

2. 0.047 285,839.906 ↓ 5.0 5 1

Subquery Scan on *SELECT* (cost=8.96..9.00 rows=1 width=212) (actual time=285,837.889..285,839.906 rows=5 loops=1)

3. 10.801 285,839.859 ↓ 5.0 5 1

GroupAggregate (cost=8.96..8.98 rows=1 width=180) (actual time=285,837.871..285,839.859 rows=5 loops=1)

  • Group Key: bus.baskv
4. 45.124 285,829.058 ↓ 15,547.0 15,547 1

Sort (cost=8.96..8.96 rows=1 width=16) (actual time=285,826.890..285,829.058 rows=15,547 loops=1)

  • Sort Key: bus.baskv
  • Sort Method: quicksort Memory: 1,113kB
5. 46,871.344 285,783.934 ↓ 15,547.0 15,547 1

Nested Loop (cost=4.89..8.95 rows=1 width=16) (actual time=743.970..285,783.934 rows=15,547 loops=1)

  • Join Filter: ((bus.bus_number)::text = (load.i)::text)
  • Rows Removed by Join Filter: 322,786,814
6. 75.801 75.801 ↓ 20,763.0 20,763 1

Index Scan using idx_bus_case_number on bus (cost=0.43..4.45 rows=1 width=14) (actual time=0.027..75.801 rows=20,763 loops=1)

  • Index Cond: (case_id = 355)
  • Filter: solution
7. 197,144.685 238,836.789 ↓ 15,547.0 15,547 20,763

GroupAggregate (cost=4.45..4.48 rows=1 width=13) (actual time=0.099..11.503 rows=15,547 loops=20,763)

  • Group Key: load.i
  • Filter: (sum(load.pl) <> '0'::double precision)
  • Rows Removed by Filter: 782
8. 41,684.545 41,692.104 ↓ 16,329.0 16,329 20,763

Sort (cost=4.45..4.46 rows=1 width=13) (actual time=0.009..2.008 rows=16,329 loops=20,763)

  • Sort Key: load.i
  • Sort Method: quicksort Memory: 1,150kB
9. 7.559 7.559 ↓ 16,329.0 16,329 1

Index Scan using idx_load_case_id on load (cost=0.42..4.44 rows=1 width=13) (actual time=0.033..7.559 rows=16,329 loops=1)

  • Index Cond: (case_id = 355)