explain.depesz.com

PostgreSQL's explain analyze made readable

Result: F9ZG

Settings
# exclusive inclusive rows x rows loops node
1. 109.744 21,446.628 ↑ 21.7 337,114 1

Unique (cost=1,154,682.62..1,521,003.02 rows=7,326,408 width=68) (actual time=9,448.793..21,446.628 rows=337,114 loops=1)

2. 10,863.961 21,336.884 ↑ 21.7 337,114 1

GroupAggregate (cost=1,154,682.62..1,466,054.96 rows=7,326,408 width=68) (actual time=9,448.791..21,336.884 rows=337,114 loops=1)

  • Group Key: hr.created, hr.well_map_id, wm.id, s.id
3. 5,210.279 10,472.923 ↓ 1.0 7,517,109 1

Sort (cost=1,154,682.62..1,172,998.64 rows=7,326,408 width=63) (actual time=9,448.714..10,472.923 rows=7,517,109 loops=1)

  • Sort Key: hr.created, wm.id, s.id
  • Sort Method: quicksort Memory: 1253702kB
4. 1,291.327 5,262.644 ↓ 1.0 7,517,109 1

Hash Join (cost=821.19..319,300.86 rows=7,326,408 width=63) (actual time=21.100..5,262.644 rows=7,517,109 loops=1)

  • Hash Cond: (wm.source_id = s.id)
5. 1,526.904 3,971.306 ↓ 1.0 7,517,109 1

Hash Join (cost=820.08..283,766.67 rows=7,326,408 width=54) (actual time=21.074..3,971.306 rows=7,517,109 loops=1)

  • Hash Cond: (hr.well_map_id = wm.id)
6. 2,423.555 2,423.555 ↓ 1.0 7,517,109 1

Index Scan using history_reading_created_53ebfcf52c6038fc_uniq on history_reading hr (cost=0.59..263,711.02 rows=7,326,408 width=46) (actual time=0.058..2,423.555 rows=7,517,109 loops=1)

  • Index Cond: (created > (now() - '21 days'::interval))
  • Filter: (well_map_id IS NOT NULL)
  • Rows Removed by Filter: 103
7. 2.682 20.847 ↑ 1.0 18,778 1

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

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

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

9. 0.005 0.011 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=13) (actual time=0.011..0.011 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
10. 0.006 0.006 ↑ 1.0 5 1

Seq Scan on history_source s (cost=0.00..1.05 rows=5 width=13) (actual time=0.005..0.006 rows=5 loops=1)

Planning time : 37.769 ms
Execution time : 21,546.617 ms