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 3649.768 ↑ 640458.7 31 1

Merge Right Join (cost=71410.57..568870.04 rows=19854219 width=68) (actual time=3489.933..3649.768 rows=31 loops=1)

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

GroupAggregate (cost=26122.44..26803.72 rows=28181 width=16) (actual time=1506.856..1665.806 rows=24 loops=1)

3. 214.598 1554.213 ↑ 1.3 26923 1

Sort (cost=26122.44..26208.63 rows=34475 width=16) (actual time=1502.858..1554.213 rows=26923 loops=1)

  • Sort Key: ((b.body_time)::date)
  • Sort Method: external merge Disk: 848kB
4. 457.414 1339.615 ↑ 1.3 26923 1

Hash Join (cost=11421.12..22932.69 rows=34475 width=16) (actual time=383.683..1339.615 rows=26923 loops=1)

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

Seq Scan on envelope e (cost=0.00..9392.30 rows=108213 width=8) (actual time=0.043..511.449 rows=105475 loops=1)

  • Filter: (envelope_command = 1)
6. 79.115 370.752 ↑ 1.0 26923 1

Hash (cost=10902.85..10902.85 rows=28181 width=24) (actual time=370.752..370.752 rows=26923 loops=1)

7. 291.637 291.637 ↑ 1.0 26923 1

Seq Scan on body b (cost=0.00..10902.85 rows=28181 width=24) (actual time=0.086..291.637 rows=26923 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 1983.102 ↑ 4545.3 31 1

Materialize (cost=45288.13..47049.45 rows=140905 width=36) (actual time=1982.939..1983.102 rows=31 loops=1)

9. 0.226 1982.975 ↑ 4545.3 31 1

Sort (cost=45288.13..45640.40 rows=140905 width=36) (actual time=1982.928..1982.975 rows=31 loops=1)

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

Merge Right Join (cost=26058.40..29622.18 rows=140905 width=36) (actual time=1763.022..1982.749 rows=31 loops=1)

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

GroupAggregate (cost=25996.07..26671.30 rows=28181 width=16) (actual time=1762.723..1982.133 rows=24 loops=1)

12. 260.844 1828.909 ↑ 1.1 29987 1

Sort (cost=25996.07..26080.24 rows=33669 width=16) (actual time=1756.452..1828.909 rows=29987 loops=1)

  • Sort Key: ((b.body_time)::date)
  • Sort Method: external merge Disk: 936kB
13. 692.817 1568.065 ↑ 1.1 29987 1

Hash Join (cost=11421.12..22886.81 rows=33669 width=16) (actual time=377.037..1568.065 rows=29987 loops=1)

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

Seq Scan on envelope e (cost=0.00..9392.30 rows=105684 width=8) (actual time=0.038..511.338 rows=107174 loops=1)

  • Filter: (envelope_command = 2)
15. 79.271 363.910 ↑ 1.0 26923 1

Hash (cost=10902.85..10902.85 rows=28181 width=24) (actual time=363.910..363.910 rows=26923 loops=1)

16. 284.639 284.639 ↑ 1.0 26923 1

Seq Scan on body b (cost=0.00..10902.85 rows=28181 width=24) (actual time=0.081..284.639 rows=26923 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=1000 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=1000 width=4) (actual time=0.082..0.169 rows=31 loops=1)