explain.depesz.com

PostgreSQL's explain analyze made readable

Result: EmEq

Settings
# exclusive inclusive rows x rows loops node
1. 1,294.849 284,561.344 ↑ 2,216.7 12,793 1

Nested Loop Left Join (cost=3,992.62..46,621,792,021.73 rows=28,357,842 width=1,419) (actual time=74.668..284,561.344 rows=12,793 loops=1)

2. 53.019 2,588.075 ↑ 2,216.7 12,793 1

Nested Loop Left Join (cost=2,372.34..668,759,795.99 rows=28,357,842 width=1,441) (actual time=52.993..2,588.075 rows=12,793 loops=1)

3. 30.750 2,253.610 ↑ 2,216.7 12,793 1

Hash Left Join (cost=2,349.23..12,701,121.32 rows=28,357,842 width=1,439) (actual time=52.960..2,253.610 rows=12,793 loops=1)

  • Hash Cond: (prog."sourceId" = s.id)
4. 29.499 2,222.800 ↑ 2,216.7 12,793 1

Hash Left Join (cost=2,342.30..12,623,006.67 rows=28,357,842 width=1,442) (actual time=52.887..2,222.800 rows=12,793 loops=1)

  • Hash Cond: (tpp."programId" = prog.id)
5. 32.792 2,193.020 ↑ 2,216.7 12,793 1

Hash Left Join (cost=2,311.27..12,547,652.60 rows=28,357,842 width=1,337) (actual time=52.600..2,193.020 rows=12,793 loops=1)

  • Hash Cond: (c."teamPropertyProgramId" = ctpp.id)
6. 27.288 2,158.776 ↑ 2,216.7 12,793 1

Hash Left Join (cost=2,257.72..12,346,622.36 rows=28,357,842 width=1,229) (actual time=51.142..2,158.776 rows=12,793 loops=1)

  • Hash Cond: (cqs."userId" = cqsu.id)
7. 126.605 2,131.409 ↑ 2,216.7 12,793 1

Hash Left Join (cost=2,243.74..12,269,828.38 rows=28,357,842 width=1,231) (actual time=51.050..2,131.409 rows=12,793 loops=1)

  • Hash Cond: (c.id = cqs."communicationId")
8. 18.700 1,970.941 ↑ 2,216.7 12,793 1

Hash Left Join (cost=174.54..3,829,425.94 rows=28,357,842 width=1,179) (actual time=2.087..1,970.941 rows=12,793 loops=1)

  • Hash Cond: (c."userId" = u.id)
9. 374.523 1,952.124 ↑ 2,216.7 12,793 1

Hash Join (cost=160.56..3,752,519.04 rows=28,357,842 width=1,181) (actual time=1.966..1,952.124 rows=12,793 loops=1)

  • Hash Cond: (p."assignedPropertyId" = prop.id)
  • Join Filter: ((timezone(prop.timezone, c.created_at))::date > ((now())::date + '-1 mons'::interval))
  • Rows Removed by Join Filter: 338857
10. 227.204 1,577.584 ↑ 242.1 351,727 1

Nested Loop (cost=158.43..3,405,515.50 rows=85,153,003 width=1,171) (actual time=1.744..1,577.584 rows=351,727 loops=1)

11. 37.615 139.880 ↑ 1.0 48,420 1

Hash Left Join (cost=144.88..9,832.86 rows=48,972 width=449) (actual time=1.710..139.880 rows=48,420 loops=1)

  • Hash Cond: (p."teamPropertyProgramId" = tpp.id)
12. 37.578 101.982 ↑ 1.0 48,420 1

Hash Left Join (cost=131.95..9,690.05 rows=48,972 width=449) (actual time=1.422..101.982 rows=48,420 loops=1)

  • Hash Cond: (p.id = lease."partyId")
13. 62.989 62.989 ↑ 1.0 48,361 1

Seq Scan on "Party" p (cost=0.00..6,663.72 rows=48,972 width=441) (actual time=0.003..62.989 rows=48,361 loops=1)

14. 0.521 1.415 ↓ 1.0 1,735 1

Hash (cost=110.36..110.36 rows=1,727 width=24) (actual time=1.415..1.415 rows=1,735 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 111kB
15. 0.894 0.894 ↓ 1.0 1,735 1

Seq Scan on "Lease" lease (cost=0.00..110.36 rows=1,727 width=24) (actual time=0.004..0.894 rows=1,735 loops=1)

  • Filter: ((status)::text = 'executed'::text)
  • Rows Removed by Filter: 1112
16. 0.129 0.283 ↓ 3.1 409 1

Hash (cost=11.30..11.30 rows=130 width=32) (actual time=0.283..0.283 rows=409 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 34kB
17. 0.154 0.154 ↓ 3.1 409 1

Seq Scan on "TeamPropertyProgram" tpp (cost=0.00..11.30 rows=130 width=32) (actual time=0.009..0.154 rows=409 loops=1)

18. 823.140 1,210.500 ↑ 248.4 7 48,420

Bitmap Heap Scan on "Communication" c (cost=13.55..51.95 rows=1,739 width=783) (actual time=0.012..0.025 rows=7 loops=48,420)

  • Recheck Cond: (parties @> ARRAY[(p.id)::character varying])
  • Heap Blocks: exact=286577
19. 387.360 387.360 ↑ 248.4 7 48,420

Bitmap Index Scan on communication_parties_gin_idx (cost=0.00..13.12 rows=1,739 width=0) (actual time=0.008..0.008 rows=7 loops=48,420)

  • Index Cond: (parties @> ARRAY[(p.id)::character varying])
20. 0.006 0.017 ↑ 1.0 6 1

Hash (cost=2.06..2.06 rows=6 width=42) (actual time=0.016..0.017 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
21. 0.011 0.011 ↑ 1.0 6 1

Seq Scan on "Property" prop (cost=0.00..2.06 rows=6 width=42) (actual time=0.006..0.011 rows=6 loops=1)

22. 0.036 0.117 ↑ 1.0 88 1

Hash (cost=12.88..12.88 rows=88 width=30) (actual time=0.117..0.117 rows=88 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
23. 0.081 0.081 ↑ 1.0 88 1

Seq Scan on "Users" u (cost=0.00..12.88 rows=88 width=30) (actual time=0.007..0.081 rows=88 loops=1)

24. 17.847 33.863 ↑ 1.0 39,369 1

Hash (cost=1,026.31..1,026.31 rows=39,831 width=84) (actual time=33.863..33.863 rows=39,369 loops=1)

  • Buckets: 32768 Batches: 2 Memory Usage: 2233kB
25. 16.016 16.016 ↑ 1.0 39,369 1

Seq Scan on "CallQueueStatistics" cqs (cost=0.00..1,026.31 rows=39,831 width=84) (actual time=0.008..16.016 rows=39,369 loops=1)

26. 0.036 0.079 ↑ 1.0 88 1

Hash (cost=12.88..12.88 rows=88 width=30) (actual time=0.079..0.079 rows=88 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
27. 0.043 0.043 ↑ 1.0 88 1

Seq Scan on "Users" cqsu (cost=0.00..12.88 rows=88 width=30) (actual time=0.005..0.043 rows=88 loops=1)

28. 0.174 1.452 ↓ 3.1 409 1

Hash (cost=51.92..51.92 rows=130 width=140) (actual time=1.452..1.452 rows=409 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 52kB
29. 0.218 1.278 ↓ 3.1 409 1

Hash Left Join (cost=21.99..51.92 rows=130 width=140) (actual time=0.394..1.278 rows=409 loops=1)

  • Hash Cond: (ctpp."propertyId" = commprop.id)
30. 0.229 1.049 ↓ 3.1 409 1

Hash Left Join (cost=19.86..49.43 rows=130 width=150) (actual time=0.378..1.049 rows=409 loops=1)

  • Hash Cond: (cprog."sourceId" = cs.id)
31. 0.227 0.740 ↓ 3.1 409 1

Hash Right Join (cost=12.93..42.13 rows=130 width=153) (actual time=0.292..0.740 rows=409 loops=1)

  • Hash Cond: (cprog.id = ctpp."programId")
32. 0.238 0.238 ↓ 1.0 361 1

Seq Scan on "Programs" cprog (cost=0.00..26.57 rows=357 width=137) (actual time=0.011..0.238 rows=361 loops=1)

33. 0.139 0.275 ↓ 3.1 409 1

Hash (cost=11.30..11.30 rows=130 width=48) (actual time=0.275..0.275 rows=409 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 40kB
34. 0.136 0.136 ↓ 3.1 409 1

Seq Scan on "TeamPropertyProgram" ctpp (cost=0.00..11.30 rows=130 width=48) (actual time=0.005..0.136 rows=409 loops=1)

35. 0.034 0.080 ↑ 1.0 86 1

Hash (cost=5.86..5.86 rows=86 width=29) (actual time=0.080..0.080 rows=86 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
36. 0.046 0.046 ↑ 1.0 86 1

Seq Scan on "Sources" cs (cost=0.00..5.86 rows=86 width=29) (actual time=0.013..0.046 rows=86 loops=1)

37. 0.004 0.011 ↑ 1.0 6 1

Hash (cost=2.06..2.06 rows=6 width=22) (actual time=0.011..0.011 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
38. 0.007 0.007 ↑ 1.0 6 1

Seq Scan on "Property" commprop (cost=0.00..2.06 rows=6 width=22) (actual time=0.004..0.007 rows=6 loops=1)

39. 0.138 0.281 ↓ 1.0 361 1

Hash (cost=26.57..26.57 rows=357 width=137) (actual time=0.281..0.281 rows=361 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 46kB
40. 0.143 0.143 ↓ 1.0 361 1

Seq Scan on "Programs" prog (cost=0.00..26.57 rows=357 width=137) (actual time=0.002..0.143 rows=361 loops=1)

41. 0.031 0.060 ↑ 1.0 86 1

Hash (cost=5.86..5.86 rows=86 width=29) (actual time=0.060..0.060 rows=86 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
42. 0.029 0.029 ↑ 1.0 86 1

Seq Scan on "Sources" s (cost=0.00..5.86 rows=86 width=29) (actual time=0.003..0.029 rows=86 loops=1)

43. 76.758 281.446 ↑ 1.0 1 12,793

Aggregate (cost=23.11..23.12 rows=1 width=32) (actual time=0.022..0.022 rows=1 loops=12,793)

44. 204.688 204.688 ↑ 1.0 1 12,793

Seq Scan on "Teams" t (cost=0.00..23.10 rows=1 width=16) (actual time=0.010..0.016 rows=1 loops=12,793)

  • Filter: (c.teams @> ARRAY[id])
  • Rows Removed by Filter: 7
45. 89.551 280,678.420 ↑ 1.0 1 12,793

Aggregate (cost=1,620.28..1,620.29 rows=1 width=32) (actual time=21.939..21.940 rows=1 loops=12,793)

46. 280,588.869 280,588.869 ↑ 241.0 1 12,793

Seq Scan on "Person" p_1 (cost=0.00..1,619.67 rows=241 width=11) (actual time=18.789..21.933 rows=1 loops=12,793)

  • Filter: (c.persons @> ARRAY[(id)::character varying])
  • Rows Removed by Filter: 49212