explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ldlO

Settings
# exclusive inclusive rows x rows loops node
1. 1.352 6,144.690 ↓ 6.6 1,906 1

Sort (cost=244,107.42..244,108.14 rows=287 width=113) (actual time=6,144.558..6,144.690 rows=1,906 loops=1)

  • Sort Key: es.id DESC
  • Sort Method: quicksort Memory: 337kB
2. 8.421 6,143.338 ↓ 6.6 1,906 1

Hash Join (cost=240,325.04..244,095.70 rows=287 width=113) (actual time=6,121.812..6,143.338 rows=1,906 loops=1)

  • Hash Cond: (es.reference_number = t.id)
3. 17.852 17.852 ↓ 6.7 1,921 1

Seq Scan on email_summaries es (cost=0.00..3,766.36 rows=287 width=38) (actual time=0.454..17.852 rows=1,921 loops=1)

  • Filter: ((((sent_on IS NULL) AND (is_queued IS TRUE)) OR (is_queued IS FALSE)) AND (processed_on IS NULL) AND ((((((date_part('day'::text, ('02/11/2019 07:13:23.497822'::timestamp without time zone - (created_on)::timestamp without time zone)) * '24'::double precision) + date_part('hour'::text, ('02/11/2019 07:13:23.497822'::timestamp without time zone - (created_on)::timestamp without time zone))) * '60'::double precision) + (date_part('minute'::text, ('02/11/2019 07:13:23.497822'::timestamp without time zone - (created_on)::timestamp without time zone)) * '60'::double precision)) + date_part('second'::text, ('02/11/2019 07:13:23.497822'::timestamp without time zone - (created_on)::timestamp without time zone))) >= '10'::double precision))
  • Rows Removed by Filter: 49015
4. 851.415 6,117.065 ↓ 1.0 1,541,436 1

Hash (cost=221,104.45..221,104.45 rows=1,537,647 width=79) (actual time=6,117.065..6,117.065 rows=1,541,436 loops=1)

  • Buckets: 2097152 Batches: 1 Memory Usage: 165956kB
5. 671.740 5,265.650 ↓ 1.0 1,541,436 1

Hash Left Join (cost=694.12..221,104.45 rows=1,537,647 width=79) (actual time=6.414..5,265.650 rows=1,541,436 loops=1)

  • Hash Cond: (u.employee_id = e.id)
6. 610.206 4,590.321 ↓ 1.0 1,541,436 1

Hash Left Join (cost=354.94..216,726.71 rows=1,537,647 width=69) (actual time=2.798..4,590.321 rows=1,541,436 loops=1)

  • Hash Cond: (t.user_id = u.id)
7. 500.599 3,977.575 ↓ 1.0 1,541,436 1

Hash Left Join (cost=13.83..212,347.05 rows=1,537,647 width=69) (actual time=0.233..3,977.575 rows=1,541,436 loops=1)

  • Hash Cond: (t.ps_product_id = pp.id)
8. 555.949 3,476.908 ↓ 1.0 1,541,436 1

Hash Left Join (cost=8.85..208,182.49 rows=1,537,647 width=59) (actual time=0.156..3,476.908 rows=1,541,436 loops=1)

  • Hash Cond: (t.task_type_id = tt.id)
9. 514.815 2,920.889 ↓ 1.0 1,541,436 1

Hash Left Join (cost=2.94..204,007.65 rows=1,537,647 width=42) (actual time=0.077..2,920.889 rows=1,541,436 loops=1)

  • Hash Cond: (t.task_status_id = ts.id)
10. 1,482.604 2,406.054 ↓ 1.0 1,541,436 1

Hash Left Join (cost=1.11..199,507.17 rows=1,537,647 width=34) (actual time=0.048..2,406.054 rows=1,541,436 loops=1)

  • Hash Cond: (t.task_priority_id = tp.id)
11. 923.437 923.437 ↓ 1.0 1,541,436 1

Seq Scan on tasks t (cost=0.00..192,048.47 rows=1,537,647 width=36) (actual time=0.019..923.437 rows=1,541,436 loops=1)

12. 0.006 0.013 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=10) (actual time=0.012..0.013 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 0.007 0.007 ↑ 1.0 5 1

Seq Scan on task_priorities tp (cost=0.00..1.05 rows=5 width=10) (actual time=0.005..0.007 rows=5 loops=1)

14. 0.009 0.020 ↑ 1.0 37 1

Hash (cost=1.37..1.37 rows=37 width=16) (actual time=0.020..0.020 rows=37 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
15. 0.011 0.011 ↑ 1.0 37 1

Seq Scan on task_statuses ts (cost=0.00..1.37 rows=37 width=16) (actual time=0.006..0.011 rows=37 loops=1)

16. 0.027 0.070 ↑ 1.0 129 1

Hash (cost=4.29..4.29 rows=129 width=21) (actual time=0.070..0.070 rows=129 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
17. 0.043 0.043 ↑ 1.0 129 1

Seq Scan on task_types tt (cost=0.00..4.29 rows=129 width=21) (actual time=0.011..0.043 rows=129 loops=1)

18. 0.019 0.068 ↑ 1.0 88 1

Hash (cost=3.88..3.88 rows=88 width=18) (actual time=0.068..0.068 rows=88 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
19. 0.049 0.049 ↑ 1.0 88 1

Seq Scan on ps_products pp (cost=0.00..3.88 rows=88 width=18) (actual time=0.008..0.049 rows=88 loops=1)

20. 1.046 2.540 ↑ 1.3 5,954 1

Hash (cost=244.94..244.94 rows=7,694 width=8) (actual time=2.540..2.540 rows=5,954 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 297kB
21. 1.494 1.494 ↑ 1.3 5,954 1

Seq Scan on users u (cost=0.00..244.94 rows=7,694 width=8) (actual time=0.007..1.494 rows=5,954 loops=1)

22. 1.169 3.589 ↑ 1.0 5,950 1

Hash (cost=264.08..264.08 rows=6,008 width=18) (actual time=3.589..3.589 rows=5,950 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 366kB
23. 2.420 2.420 ↑ 1.0 5,950 1

Seq Scan on employees e (cost=0.00..264.08 rows=6,008 width=18) (actual time=0.009..2.420 rows=5,950 loops=1)