explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5p9T : Original With Mat

Settings
# exclusive inclusive rows x rows loops node
1. 0.009 9,315.476 ↑ 14.3 14 1

Sort (cost=153,361.83..153,362.33 rows=200 width=36) (actual time=9,315.476..9,315.476 rows=14 loops=1)

  • Sort Key: i.bucket
  • Sort Method: quicksort Memory: 26kB
2. 211.966 9,315.467 ↑ 14.3 14 1

HashAggregate (cost=153,350.19..153,354.19 rows=200 width=36) (actual time=9,315.462..9,315.467 rows=14 loops=1)

  • Group Key: i.bucket
3. 1,231.379 9,103.501 ↓ 1.2 768,428 1

Nested Loop Left Join (cost=728.99..140,781.31 rows=628,444 width=53) (actual time=1,649.270..9,103.501 rows=768,428 loops=1)

  • Join Filter: ((t0.began >= ('{"2020-03-02 00:00:00+11","2020-03-09 00:00:00+11","2020-03-16 00:00:00+11","2020-03-23 00:00:00+11","2020-03-30 00:00:00+11","2020-04-06 00:00:00+10","2020-04-13 00:00:00+10","2020-04-20 00:00:00+10","2020-04-27 00:00:00+10","2020-05-04 00:00:00+10","2020-05-11 00:00:00+10","2020-05-18 00:00:00+10","2020-05-25 00:00:00+10","2020-06-01 00:00:00+10","2020-06-12 00:00:00+10"}'::timestamp with time zone[])[i.bucket]) AND (t0.began < ('{"2020-03-02 00:00:00+11","2020-03-09 00:00:00+11","2020-03-16 00:00:00+11","2020-03-23 00:00:00+11","2020-03-30 00:00:00+11","2020-04-06 00:00:00+10","2020-04-13 00:00:00+10","2020-04-20 00:00:00+10","2020-04-27 00:00:00+10","2020-05-04 00:00:00+10","2020-05-11 00:00:00+10","2020-05-18 00:00:00+10","2020-05-25 00:00:00+10","2020-06-01 00:00:00+10","2020-06-12 00:00:00+10"}'::timestamp with time zone[])[(i.bucket + 1)]))
  • Rows Removed by Join Filter: 9,989,564
4. 0.020 0.020 ↑ 71.4 14 1

Function Scan on generate_series i (cost=0.00..10.00 rows=1,000 width=4) (actual time=0.006..0.020 rows=14 loops=1)

5. 1,190.579 7,872.102 ↓ 135.9 768,428 14

Materialize (cost=728.99..27,665.44 rows=5,656 width=57) (actual time=1.117..562.293 rows=768,428 loops=14)

6. 102.716 6,681.523 ↓ 135.9 768,428 1

Nested Loop (cost=728.99..27,637.16 rows=5,656 width=57) (actual time=15.586..6,681.523 rows=768,428 loops=1)

7. 11.351 3,697.202 ↓ 134.8 192,107 1

Nested Loop (cost=728.43..15,711.11 rows=1,425 width=24) (actual time=15.575..3,697.202 rows=192,107 loops=1)

8. 19.825 3,109.485 ↓ 134.8 192,122 1

Nested Loop (cost=728.01..14,973.93 rows=1,425 width=24) (actual time=15.566..3,109.485 rows=192,122 loops=1)

9. 68.925 2,513.282 ↓ 135.5 192,126 1

Nested Loop (cost=727.59..14,256.37 rows=1,418 width=24) (actual time=15.559..2,513.282 rows=192,126 loops=1)

10. 32.503 1,867.742 ↓ 172.4 192,205 1

Nested Loop (cost=727.16..6,197.77 rows=1,115 width=24) (actual time=15.548..1,867.742 rows=192,205 loops=1)

11. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=32) (actual time=0.000..0.001 rows=1 loops=1)

12. 1,820.661 1,835.238 ↓ 172.4 192,205 1

Bitmap Heap Scan on call t0 (cost=727.16..6,186.60 rows=1,115 width=24) (actual time=15.544..1,835.238 rows=192,205 loops=1)

  • Recheck Cond: ((began >= ('{"2020-03-02 00:00:00+11","2020-03-09 00:00:00+11","2020-03-16 00:00:00+11","2020-03-23 00:00:00+11","2020-03-30 00:00:00+11","2020-04-06 00:00:00+10","2020-04-13 00:00:00+10","2020-04-20 00:00:00+10","2020-04-27 00:00:00+10","2020-05-04 00:00:00+10","2020-05-11 00:00:00+10","2020-05-18 00:00:00+10","2020-05-25 00:00:00+10","2020-06-01 00:00:00+10","2020-06-12 00:00:00+10"}'::timestamp with time zone[])[1]) AND (began < ('{"2020-03-02 00:00:00+11","2020-03-09 00:00:00+11","2020-03-16 00:00:00+11","2020-03-23 00:00:00+11","2020-03-30 00:00:00+11","2020-04-06 00:00:00+10","2020-04-13 00:00:00+10","2020-04-20 00:00:00+10","2020-04-27 00:00:00+10","2020-05-04 00:00:00+10","2020-05-11 00:00:00+10","2020-05-18 00:00:00+10","2020-05-25 00:00:00+10","2020-06-01 00:00:00+10","2020-06-12 00:00:00+10"}'::timestamp with time zone[])[15]))
  • Filter: (lisa_super_user() OR ((hashed SubPlan 1) IS TRUE))
  • Heap Blocks: exact=6,983
13. 14.577 14.577 ↓ 115.0 192,205 1

Bitmap Index Scan on call_idx_began (cost=0.00..77.14 rows=1,672 width=0) (actual time=14.577..14.577 rows=192,205 loops=1)

  • Index Cond: ((began >= ('{"2020-03-02 00:00:00+11","2020-03-09 00:00:00+11","2020-03-16 00:00:00+11","2020-03-23 00:00:00+11","2020-03-30 00:00:00+11","2020-04-06 00:00:00+10","2020-04-13 00:00:00+10","2020-04-20 00:00:00+10","2020-04-27 00:00:00+10","2020-05-04 00:00:00+10","2020-05-11 00:00:00+10","2020-05-18 00:00:00+10","2020-05-25 00:00:00+10","2020-06-01 00:00:00+10","2020-06-12 00:00:00+10"}'::timestamp with time zone[])[1]) AND (began < ('{"2020-03-02 00:00:00+11","2020-03-09 00:00:00+11","2020-03-16 00:00:00+11","2020-03-23 00:00:00+11","2020-03-30 00:00:00+11","2020-04-06 00:00:00+10","2020-04-13 00:00:00+10","2020-04-20 00:00:00+10","2020-04-27 00:00:00+10","2020-05-04 00:00:00+10","2020-05-11 00:00:00+10","2020-05-18 00:00:00+10","2020-05-25 00:00:00+10","2020-06-01 00:00:00+10","2020-06-12 00:00:00+10"}'::timestamp with time zone[])[15]))
14.          

SubPlan (for Bitmap Heap Scan)

15. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=71.08..604.41 rows=18,133 width=16) (never executed)

  • Hash Cond: (((((unnest(regexp_match(t1_1.c1, '^team_(.+)'::text))))::character varying))::text = (t0_1.access_control_name)::text)
16. 0.000 0.000 ↓ 0.0 0

Result (cost=0.01..202.01 rows=10,000 width=32) (never executed)

17. 0.000 0.000 ↓ 0.0 0

ProjectSet (cost=0.01..52.01 rows=10,000 width=32) (never executed)

18. 0.000 0.000 ↓ 0.0 0

Function Scan on json_array_elements_text t1_1 (cost=0.01..1.01 rows=100 width=32) (never executed)

19. 0.000 0.000 ↓ 0.0 0

Hash (cost=54.07..54.07 rows=1,360 width=48) (never executed)

20. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=26.88..54.07 rows=1,360 width=48) (never executed)

  • Hash Cond: (t2_1.ac_team_id = t0_1.id)
21. 0.000 0.000 ↓ 0.0 0

Seq Scan on ac_team_membership t2_1 (cost=0.00..23.60 rows=1,360 width=32) (never executed)

22. 0.000 0.000 ↓ 0.0 0

Hash (cost=17.50..17.50 rows=750 width=48) (never executed)

23. 0.000 0.000 ↓ 0.0 0

Seq Scan on ac_team t0_1 (cost=0.00..17.50 rows=750 width=48) (never executed)

24. 576.615 576.615 ↑ 1.0 1 192,205

Index Scan using transcript_unique_call_id on transcript t1 (cost=0.42..7.23 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=192,205)

  • Index Cond: (call_id = t0.id)
25. 576.378 576.378 ↑ 1.0 1 192,126

Index Scan using enriched_transcript_unique_transcript_id on enriched_transcript t2 (cost=0.42..0.51 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=192,126)

  • Index Cond: (transcript_id = t1.id)
26. 576.366 576.366 ↑ 1.0 1 192,122

Index Scan using scorecard_run_unique_enriched_transcript_id on scorecard_run t3 (cost=0.42..0.52 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=192,122)

  • Index Cond: (enriched_transcript_id = t2.id)
27. 2,881.605 2,881.605 ↑ 6.2 4 192,107

Index Scan using scorecard_result_idx_scorecard_run_id_parent on scorecard_result t4 (cost=0.56..8.12 rows=25 width=65) (actual time=0.010..0.015 rows=4 loops=192,107)

  • Index Cond: (scorecard_run_id = t3.id)
  • Filter: ((parent IS NULL) OR ((question)::text = ANY ('{Communication,Compliance,Conduct}'::text[])))
  • Rows Removed by Filter: 29