explain.depesz.com

A tool for finding a real cause for slow queries.

Result: 1LA

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 0.860 3,649.768 ↑ 640,458.7 31 1

Merge Right Join (cost=71,410.57..568,870.04 rows=19,854,219 width=68) (actual time=3,489.933..3,649.768 rows=31 loops=1)

  • Merge Cond: (((b.body_time)::date) = (('2009-10-01'::date + s.day)))
2. 111.593 1,665.806 ↑ 1,174.2 24 1

GroupAggregate (cost=26,122.44..26,803.72 rows=28,181 width=16) (actual time=1,506.856..1,665.806 rows=24 loops=1)

3. 214.598 1,554.213 ↑ 1.3 26,923 1

Sort (cost=26,122.44..26,208.63 rows=34,475 width=16) (actual time=1,502.858..1,554.213 rows=26,923 loops=1)

  • Sort Key: ((b.body_time)::date)
  • Sort Method: external merge Disk: 848kB
4. 457.414 1,339.615 ↑ 1.3 26,923 1

Hash Join (cost=11,421.12..22,932.69 rows=34,475 width=16) (actual time=383.683..1,339.615 rows=26,923 loops=1)

  • Hash Cond: (e.message_id = b.message_id)
5. 511.449 511.449 ↑ 1.0 105,475 1

Seq Scan on envelope e (cost=0.00..9,392.30 rows=108,213 width=8) (actual time=0.043..511.449 rows=105,475 loops=1)

  • Filter: (envelope_command = 1)
6. 79.115 370.752 ↑ 1.0 26,923 1

Hash (cost=10,902.85..10,902.85 rows=28,181 width=24) (actual time=370.752..370.752 rows=26,923 loops=1)

7. 291.637 291.637 ↑ 1.0 26,923 1

Seq Scan on body b (cost=0.00..10,902.85 rows=28,181 width=24) (actual time=0.086..291.637 rows=26,923 loops=1)

  • Filter: ((body_time >= '2009-10-01 00:00:00'::timestamp without time zone) AND (body_time <= '2009-11-01 00:00:00'::timestamp without time zone))
8. 0.127 1,983.102 ↑ 4,545.3 31 1

Materialize (cost=45,288.13..47,049.45 rows=140,905 width=36) (actual time=1,982.939..1,983.102 rows=31 loops=1)

9. 0.226 1,982.975 ↑ 4,545.3 31 1

Sort (cost=45,288.13..45,640.40 rows=140,905 width=36) (actual time=1,982.928..1,982.975 rows=31 loops=1)

  • Sort Key: (('2009-10-01'::date + s.day))
  • Sort Method: quicksort Memory: 18kB
10. 0.281 1,982.749 ↑ 4,545.3 31 1

Merge Right Join (cost=26,058.40..29,622.18 rows=140,905 width=36) (actual time=1,763.022..1,982.749 rows=31 loops=1)

  • Merge Cond: (((b.body_time)::date) = (('2009-10-01'::date + s.day)))
11. 153.224 1,982.133 ↑ 1,174.2 24 1

GroupAggregate (cost=25,996.07..26,671.30 rows=28,181 width=16) (actual time=1,762.723..1,982.133 rows=24 loops=1)

12. 260.844 1,828.909 ↑ 1.1 29,987 1

Sort (cost=25,996.07..26,080.24 rows=33,669 width=16) (actual time=1,756.452..1,828.909 rows=29,987 loops=1)

  • Sort Key: ((b.body_time)::date)
  • Sort Method: external merge Disk: 936kB
13. 692.817 1,568.065 ↑ 1.1 29,987 1

Hash Join (cost=11,421.12..22,886.81 rows=33,669 width=16) (actual time=377.037..1,568.065 rows=29,987 loops=1)

  • Hash Cond: (e.message_id = b.message_id)
14. 511.338 511.338 ↓ 1.0 107,174 1

Seq Scan on envelope e (cost=0.00..9,392.30 rows=105,684 width=8) (actual time=0.038..511.338 rows=107,174 loops=1)

  • Filter: (envelope_command = 2)
15. 79.271 363.910 ↑ 1.0 26,923 1

Hash (cost=10,902.85..10,902.85 rows=28,181 width=24) (actual time=363.910..363.910 rows=26,923 loops=1)

16. 284.639 284.639 ↑ 1.0 26,923 1

Seq Scan on body b (cost=0.00..10,902.85 rows=28,181 width=24) (actual time=0.081..284.639 rows=26,923 loops=1)

  • Filter: ((body_time >= '2009-10-01 00:00:00'::timestamp without time zone) AND (body_time <= '2009-11-01 00:00:00'::timestamp without time zone))
17. 0.166 0.335 ↑ 32.3 31 1

Sort (cost=62.33..64.83 rows=1,000 width=4) (actual time=0.286..0.335 rows=31 loops=1)

  • Sort Key: (('2009-10-01'::date + s.day))
  • Sort Method: quicksort Memory: 18kB
18. 0.169 0.169 ↑ 32.3 31 1

Function Scan on generate_series s (cost=0.00..12.50 rows=1,000 width=4) (actual time=0.082..0.169 rows=31 loops=1)