explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sjN6

Settings
# exclusive inclusive rows x rows loops node
1. 3.602 8,039.227 ↑ 93.7 9,953 1

Merge Join (cost=988,685.62..1,002,718.68 rows=932,221 width=4) (actual time=8,033.132..8,039.227 rows=9,953 loops=1)

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

CTE excludedaccountcte

3. 3.087 5,023.628 ↑ 56,013.5 54 1

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

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

CTE excludedemailsentcte

5. 670.503 2,456.787 ↓ 2.1 40,060 1

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

  • Group Key: t_emailaccountfact.c_accountid
6. 1,786.284 1,786.284 ↑ 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.622..1,786.284 rows=4,132,412 loops=1)

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

CTE excludedfilesssentcte

8. 692.217 2,517.028 ↓ 1.2 39,994 1

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

  • Group Key: t_filesaccountfact.c_accountid
9. 1,824.811 1,824.811 ↓ 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,824.811 rows=4,121,108 loops=1)

  • Filter: (NOT c_isinternalinitiated)
  • Rows Removed by Filter: 4,122,410
10. 11.029 2,477.264 ↑ 312.3 60 1

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

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

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

12. 15.846 2,543.277 ↓ 1.2 39,994 1

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

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

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

14.          

CTE includedmeetingactivitytypecte

15. 2.762 5,426.100 ↓ 1.0 9,960 1

HashSetOp Except (cost=32,433.47..130,961.05 rows=9,949 width=8) (actual time=5,425.093..5,426.100 rows=9,960 loops=1)

16. 0.854 5,423.338 ↑ 301.4 10,068 1

Append (cost=32,433.47..123,374.35 rows=3,034,679 width=8) (actual time=396.080..5,423.338 rows=10,068 loops=1)

17. 1.197 398.828 ↓ 1.0 10,014 1

Subquery Scan on *SELECT* 1 (cost=32,433.47..32,632.46 rows=9,949 width=8) (actual time=396.080..398.828 rows=10,014 loops=1)

18. 183.723 397.631 ↓ 1.0 10,014 1

HashAggregate (cost=32,433.47..32,532.97 rows=9,949 width=4) (actual time=396.078..397.631 rows=10,014 loops=1)

  • Group Key: t_meetingaccountfact.c_accountid
19. 213.908 213.908 ↓ 1.0 1,122,519 1

Seq Scan on t_meetingaccountfact (cost=0.00..29,627.18 rows=1,122,518 width=4) (actual time=0.011..213.908 rows=1,122,519 loops=1)

20. 0.014 5,023.656 ↑ 56,013.5 54 1

Subquery Scan on *SELECT* 2 (cost=0.00..90,741.90 rows=3,024,730 width=8) (actual time=5,015.865..5,023.656 rows=54 loops=1)

21. 5,023.642 5,023.642 ↑ 56,013.5 54 1

CTE Scan on excludedaccountcte (cost=0.00..60,494.60 rows=3,024,730 width=4) (actual time=5,015.863..5,023.642 rows=54 loops=1)

22.          

CTE includedemailreceviedactivitytypecte

23. 10.800 2,581.642 ↓ 2.1 39,939 1

HashSetOp Except (cost=235,352.26..334,077.63 rows=18,740 width=8) (actual time=2,578.031..2,581.642 rows=39,939 loops=1)

24. 3.485 2,570.842 ↑ 76.0 40,047 1

Append (cost=235,352.26..326,468.96 rows=3,043,470 width=8) (actual time=2,555.350..2,570.842 rows=40,047 loops=1)

25. 4.711 2,567.346 ↓ 2.1 39,993 1

Subquery Scan on *SELECT* 1_1 (cost=235,352.26..235,727.06 rows=18,740 width=8) (actual time=2,555.349..2,567.346 rows=39,993 loops=1)

26. 697.985 2,562.635 ↓ 2.1 39,993 1

HashAggregate (cost=235,352.26..235,539.66 rows=18,740 width=4) (actual time=2,555.348..2,562.635 rows=39,993 loops=1)

  • Group Key: t_emailaccountfact_1.c_accountid
27. 1,864.650 1,864.650 ↓ 1.0 4,121,108 1

Seq Scan on t_emailaccountfact t_emailaccountfact_1 (cost=0.00..225,110.30 rows=4,096,783 width=4) (actual time=0.027..1,864.650 rows=4,121,108 loops=1)

  • Filter: (NOT c_isinternalinitiated)
  • Rows Removed by Filter: 4,132,412
28. 0.004 0.011 ↑ 56,013.5 54 1

Subquery Scan on *SELECT* 2_1 (cost=0.00..90,741.90 rows=3,024,730 width=8) (actual time=0.002..0.011 rows=54 loops=1)

29. 0.007 0.007 ↑ 56,013.5 54 1

CTE Scan on excludedaccountcte excludedaccountcte_1 (cost=0.00..60,494.60 rows=3,024,730 width=4) (actual time=0.002..0.007 rows=54 loops=1)

30. 3.755 5,432.312 ↓ 1.0 9,960 1

Sort (cost=859.61..884.48 rows=9,949 width=4) (actual time=5,431.187..5,432.312 rows=9,960 loops=1)

  • Sort Key: a.c
  • Sort Method: quicksort Memory: 851kB
31. 5,428.557 5,428.557 ↓ 1.0 9,960 1

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

32. 12.362 2,603.313 ↑ 1.9 9,954 1

Sort (cost=1,704.76..1,751.61 rows=18,740 width=4) (actual time=2,601.941..2,603.313 rows=9,954 loops=1)

  • Sort Key: b.c
  • Sort Method: quicksort Memory: 3,238kB
33. 2,590.951 2,590.951 ↓ 2.1 39,939 1

CTE Scan on includedemailreceviedactivitytypecte b (cost=0.00..374.80 rows=18,740 width=4) (actual time=2,578.032..2,590.951 rows=39,939 loops=1)

Planning time : 0.359 ms
Execution time : 8,042.100 ms