explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ztiY

Settings
# exclusive inclusive rows x rows loops node
1. 115.689 20,855.692 ↑ 21.7 339,191 1

Unique (cost=1,325,466.85..1,694,317.20 rows=7,377,007 width=68) (actual time=8,987.187..20,855.692 rows=339,191 loops=1)

2. 10,767.142 20,740.003 ↑ 21.7 339,191 1

GroupAggregate (cost=1,325,466.85..1,638,989.65 rows=7,377,007 width=68) (actual time=8,987.186..20,740.003 rows=339,191 loops=1)

  • Group Key: hr.created, hr.well_map_id, wm.id, s.id
3. 5,348.376 9,972.861 ↓ 1.0 7,564,393 1

Sort (cost=1,325,466.85..1,343,909.37 rows=7,377,007 width=63) (actual time=8,987.125..9,972.861 rows=7,564,393 loops=1)

  • Sort Key: hr.created, wm.id, s.id
  • Sort Method: external merge Disk: 604528kB
4. 1,334.963 4,624.485 ↓ 1.0 7,564,393 1

Hash Join (cost=821.19..321,495.08 rows=7,377,007 width=63) (actual time=6.126..4,624.485 rows=7,564,393 loops=1)

  • Hash Cond: (wm.source_id = s.id)
5. 1,546.961 3,289.512 ↓ 1.0 7,564,393 1

Hash Join (cost=820.08..285,715.48 rows=7,377,007 width=54) (actual time=6.109..3,289.512 rows=7,564,393 loops=1)

  • Hash Cond: (hr.well_map_id = wm.id)
6. 1,736.649 1,736.649 ↓ 1.0 7,564,393 1

Index Scan using history_reading_created_53ebfcf52c6038fc_uniq on history_reading hr (cost=0.59..265,526.98 rows=7,377,007 width=46) (actual time=0.030..1,736.649 rows=7,564,393 loops=1)

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

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

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

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

9. 0.005 0.010 ↑ 1.0 5 1

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

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

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

Planning time : 0.483 ms
Execution time : 20,962.397 ms