explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VeUr

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 5,022.037 ↓ 0.0 0 1

Merge Join (cost=890,257.55..904,290.61 rows=932,221 width=4) (actual time=5,022.037..5,022.037 rows=0 loops=1)

  • Merge Cond: (a.c = b.c)
2.          

CTE excludedaccountcte

3. 0.005 5,022.010 ↑ 3,024,730.0 1 1

Merge Join (cost=475,617.91..521,082.56 rows=3,024,730 width=4) (actual time=5,022.010..5,022.010 rows=1 loops=1)

  • Merge Cond: (a_1.c = b_1.c)
4.          

CTE excludedemailsentcte

5. 689.139 2,503.860 ↓ 2.1 40,060 1

HashAggregate (cost=235,527.17..235,714.57 rows=18,740 width=4) (actual time=2,495.764..2,503.860 rows=40,060 loops=1)

  • Group Key: t_emailaccountfact.c_accountid
6. 1,814.721 1,814.721 ↑ 1.0 4,132,412 1

Seq Scan on t_emailaccountfact (cost=0.00..225,110.30 rows=4,166,747 width=4) (actual time=98.314..1,814.721 rows=4,132,412 loops=1)

  • Filter: c_isinternalinitiated
  • Rows Removed by Filter: 4,121,108
7.          

CTE excludedfilesssentcte

8. 678.162 2,478.617 ↓ 1.2 39,994 1

HashAggregate (cost=234,812.56..235,135.37 rows=32,281 width=4) (actual time=2,470.982..2,478.617 rows=39,994 loops=1)

  • Group Key: t_filesaccountfact.c_accountid
9. 1,800.455 1,800.455 ↓ 1.0 4,121,108 1

Seq Scan on t_filesaccountfact (cost=0.00..224,565.18 rows=4,098,952 width=4) (actual time=0.047..1,800.455 rows=4,121,108 loops=1)

  • Filter: (NOT c_isinternalinitiated)
  • Rows Removed by Filter: 4,122,410
10. 10.361 2,523.439 ↑ 18,740.0 1 1

Sort (cost=1,704.76..1,751.61 rows=18,740 width=4) (actual time=2,523.439..2,523.439 rows=1 loops=1)

  • Sort Key: a_1.c
  • Sort Method: quicksort Memory: 3,244kB
11. 2,513.078 2,513.078 ↓ 2.1 40,060 1

CTE Scan on excludedemailsentcte a_1 (cost=0.00..374.80 rows=18,740 width=4) (actual time=2,495.767..2,513.078 rows=40,060 loops=1)

12. 10.562 2,498.566 ↑ 32,281.0 1 1

Sort (cost=3,063.21..3,143.91 rows=32,281 width=4) (actual time=2,498.566..2,498.566 rows=1 loops=1)

  • Sort Key: b_1.c
  • Sort Method: quicksort Memory: 3,241kB
13. 2,488.004 2,488.004 ↓ 1.2 39,994 1

CTE Scan on excludedfilesssentcte b_1 (cost=0.00..645.62 rows=32,281 width=4) (actual time=2,470.984..2,488.004 rows=39,994 loops=1)

14.          

CTE includedmeetingactivitytypecte

15. 0.000 5,022.030 ↓ 0.0 0 1

HashAggregate (cost=32,433.49..32,532.99 rows=9,949 width=4) (actual time=5,022.030..5,022.030 rows=0 loops=1)

  • Group Key: t_meetingaccountfact.c_accountid
16.          

Initplan (for HashAggregate)

17. 5,022.011 5,022.011 ↑ 3,024,730.0 1 1

CTE Scan on excludedaccountcte (cost=0.00..60,494.60 rows=3,024,730 width=0) (actual time=5,022.011..5,022.011 rows=1 loops=1)

18. 5,022.014 5,022.014 ↓ 0.0 0 1

Result (cost=0.00..29,627.18 rows=1,122,518 width=4) (actual time=5,022.013..5,022.014 rows=0 loops=1)

  • One-Time Filter: (NOT $3)
19. 0.000 0.000 ↓ 0.0 0

Seq Scan on t_meetingaccountfact (cost=0.00..29,627.18 rows=1,122,518 width=4) (never executed)

20.          

CTE includedemailreceviedactivitytypecte

21. 0.000 0.000 ↓ 0.0 0

HashSetOp Except (cost=235,352.26..334,077.63 rows=18,740 width=8) (never executed)

22. 0.000 0.000 ↓ 0.0 0

Append (cost=235,352.26..326,468.96 rows=3,043,470 width=8) (never executed)

23. 0.000 0.000 ↓ 0.0 0

Subquery Scan on *SELECT* 1 (cost=235,352.26..235,727.06 rows=18,740 width=8) (never executed)

24. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=235,352.26..235,539.66 rows=18,740 width=4) (never executed)

  • Group Key: t_emailaccountfact_1.c_accountid
25. 0.000 0.000 ↓ 0.0 0

Seq Scan on t_emailaccountfact t_emailaccountfact_1 (cost=0.00..225,110.30 rows=4,096,783 width=4) (never executed)

  • Filter: (NOT c_isinternalinitiated)
26. 0.000 0.000 ↓ 0.0 0

Subquery Scan on *SELECT* 2 (cost=0.00..90,741.90 rows=3,024,730 width=8) (never executed)

27. 0.000 0.000 ↓ 0.0 0

CTE Scan on excludedaccountcte excludedaccountcte_1 (cost=0.00..60,494.60 rows=3,024,730 width=4) (never executed)

28. 0.005 5,022.035 ↓ 0.0 0 1

Sort (cost=859.61..884.48 rows=9,949 width=4) (actual time=5,022.035..5,022.035 rows=0 loops=1)

  • Sort Key: a.c
  • Sort Method: quicksort Memory: 25kB
29. 5,022.030 5,022.030 ↓ 0.0 0 1

CTE Scan on includedmeetingactivitytypecte a (cost=0.00..198.98 rows=9,949 width=4) (actual time=5,022.030..5,022.030 rows=0 loops=1)

30. 0.000 0.000 ↓ 0.0 0

Sort (cost=1,704.76..1,751.61 rows=18,740 width=4) (never executed)

  • Sort Key: b.c
31. 0.000 0.000 ↓ 0.0 0

CTE Scan on includedemailreceviedactivitytypecte b (cost=0.00..374.80 rows=18,740 width=4) (never executed)

Planning time : 0.309 ms
Execution time : 5,023.812 ms