explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GABJ

Settings
# exclusive inclusive rows x rows loops node
1. 138.439 17,367.374 ↑ 21.6 331,363 1

Hash Join (cost=1,296,329.07..1,548,174.89 rows=7,169,867 width=60) (actual time=5,187.305..17,367.374 rows=331,363 loops=1)

  • Hash Cond: (squashed.well_map_id = wm.id)
2.          

CTE squashed

3. 119.250 16,991.862 ↑ 21.6 331,363 1

Unique (cost=1,079,978.05..1,295,509.57 rows=7,169,867 width=52) (actual time=5,181.989..16,991.862 rows=331,363 loops=1)

4. 10,628.643 16,872.612 ↑ 21.6 331,363 1

GroupAggregate (cost=1,079,978.05..1,259,660.24 rows=7,169,867 width=52) (actual time=5,181.986..16,872.612 rows=331,363 loops=1)

  • Group Key: hr.created, hr.well_map_id
5. 4,573.337 6,243.969 ↓ 1.0 7,389,172 1

Sort (cost=1,079,978.05..1,097,989.82 rows=7,204,708 width=46) (actual time=5,181.926..6,243.969 rows=7,389,172 loops=1)

  • Sort Key: hr.created, hr.well_map_id
  • Sort Method: quicksort Memory: 1037966kB
6. 1,670.632 1,670.632 ↓ 1.0 7,389,172 1

Index Scan using history_reading_created_53ebfcf52c6038fc_uniq on history_reading hr (cost=0.59..259,343.49 rows=7,204,708 width=46) (actual time=0.014..1,670.632 rows=7,389,172 loops=1)

  • Index Cond: (created > (now() - '21 days'::interval))
  • Filter: (well_map_id IS NOT NULL)
  • Rows Removed by Filter: 103
7. 17,223.671 17,223.671 ↑ 21.6 331,363 1

CTE Scan on squashed (cost=0.00..143,397.34 rows=7,169,867 width=52) (actual time=5,181.991..17,223.671 rows=331,363 loops=1)

8. 2.133 5.264 ↑ 1.0 18,778 1

Hash (cost=584.22..584.22 rows=18,822 width=8) (actual time=5.264..5.264 rows=18,778 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 990kB
9. 3.131 3.131 ↑ 1.0 18,778 1

Seq Scan on history_wellmapping wm (cost=0.00..584.22 rows=18,822 width=8) (actual time=0.014..3.131 rows=18,778 loops=1)

Planning time : 0.312 ms
Execution time : 17,487.182 ms