explain.depesz.com

PostgreSQL's explain analyze made readable

Result: EIjB

Settings
# exclusive inclusive rows x rows loops node
1. 0.272 855.894 ↓ 754.0 1,508 1

Append (cost=424.66..3,631.81 rows=2 width=265) (actual time=127.552..855.894 rows=1,508 loops=1)

2. 1.012 333.345 ↓ 539.0 539 1

Nested Loop Left Join (cost=424.66..1,236.84 rows=1 width=321) (actual time=127.551..333.345 rows=539 loops=1)

  • Filter: ((ahr.user_id IS NULL) = (user_1.id IS NULL))
  • Rows Removed by Filter: 2
3. 0.296 313.939 ↓ 541.0 541 1

Nested Loop (cost=424.37..1,236.43 rows=1 width=308) (actual time=127.062..313.939 rows=541 loops=1)

4. 0.407 307.151 ↓ 541.0 541 1

Nested Loop Left Join (cost=424.09..1,230.53 rows=1 width=236) (actual time=125.991..307.151 rows=541 loops=1)

  • Filter: (ahrv.id IS NULL)
  • Rows Removed by Filter: 360
5. 4.460 220.248 ↓ 2.0 901 1

Hash Join (cost=423.80..988.61 rows=440 width=236) (actual time=122.673..220.248 rows=901 loops=1)

  • Hash Cond: (ahr.ad_hoc_request_group_id = ahg.id)
6. 96.831 96.831 ↑ 1.0 24,484 1

Seq Scan on ad_hoc_request ahr (cost=0.00..498.91 rows=25,091 width=79) (actual time=1.461..96.831 rows=24,484 loops=1)

7. 0.676 118.957 ↑ 1.0 168 1

Hash (cost=421.70..421.70 rows=168 width=189) (actual time=118.957..118.957 rows=168 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 60kB
8. 118.281 118.281 ↑ 1.0 168 1

Seq Scan on ad_hoc_request_group ahg (cost=0.00..421.70 rows=168 width=189) (actual time=6.020..118.281 rows=168 loops=1)

  • Filter: (expires > now())
  • Rows Removed by Filter: 9,309
9. 86.496 86.496 ↓ 0.0 0 901

Index Scan using ad_hoc_review_ad_hoc_request_id_key on ad_hoc_review ahrv (cost=0.29..0.54 rows=1 width=32) (actual time=0.096..0.096 rows=0 loops=901)

  • Index Cond: (ad_hoc_request_id = ahr.id)
10. 6.492 6.492 ↑ 1.0 1 541

Index Scan using user_pkey on "user" (cost=0.29..5.90 rows=1 width=88) (actual time=0.012..0.012 rows=1 loops=541)

  • Index Cond: (id = ahg.user_id)
  • Filter: (status = ANY ('{invited,active}'::user_status[]))
11. 18.394 18.394 ↑ 1.0 1 541

Index Scan using user_pkey on "user" user_1 (cost=0.29..0.40 rows=1 width=88) (actual time=0.034..0.034 rows=1 loops=541)

  • Index Cond: (id = ahr.user_id)
  • Filter: (status = ANY ('{invited,active}'::user_status[]))
  • Rows Removed by Filter: 0
12. 1.362 522.277 ↓ 969.0 969 1

Nested Loop Left Join (cost=642.67..2,394.94 rows=1 width=209) (actual time=135.515..522.277 rows=969 loops=1)

  • Filter: ((qr.user_id IS NULL) = (user_3.id IS NULL))
  • Rows Removed by Filter: 4
13. 0.276 517.996 ↓ 973.0 973 1

Nested Loop (cost=642.38..2,394.57 rows=1 width=245) (actual time=135.496..517.996 rows=973 loops=1)

14. 1.192 506.044 ↓ 973.0 973 1

Nested Loop (cost=642.10..2,390.95 rows=1 width=218) (actual time=135.445..506.044 rows=973 loops=1)

15. 0.704 501.918 ↓ 978.0 978 1

Nested Loop Left Join (cost=641.82..2,386.89 rows=1 width=146) (actual time=135.403..501.918 rows=978 loops=1)

  • Filter: (qrv.id IS NULL)
  • Rows Removed by Filter: 667
16. 8.787 254.464 ↓ 1.7 1,645 1

Hash Join (cost=641.53..1,703.64 rows=970 width=146) (actual time=133.160..254.464 rows=1,645 loops=1)

  • Hash Cond: (qr.questionnaire_request_group_id = qg.id)
17. 114.811 114.811 ↓ 1.0 46,905 1

Seq Scan on questionnaire_request qr (cost=0.00..938.98 rows=46,898 width=80) (actual time=0.023..114.811 rows=46,905 loops=1)

18. 1.344 130.866 ↑ 1.0 420 1

Hash (cost=636.26..636.26 rows=421 width=98) (actual time=130.865..130.866 rows=420 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 61kB
19. 129.522 129.522 ↑ 1.0 420 1

Seq Scan on questionnaire_request_group qg (cost=0.00..636.26 rows=421 width=98) (actual time=0.046..129.522 rows=420 loops=1)

  • Filter: (expires > now())
  • Rows Removed by Filter: 19,935
20. 246.750 246.750 ↓ 0.0 0 1,645

Index Scan using questionnaire_review_questionnaire_request_id_key on questionnaire_review qrv (cost=0.29..0.69 rows=1 width=32) (actual time=0.150..0.150 rows=0 loops=1,645)

  • Index Cond: (questionnaire_request_id = qr.id)
21. 2.934 2.934 ↑ 1.0 1 978

Index Scan using user_pkey on "user" user_2 (cost=0.29..4.06 rows=1 width=88) (actual time=0.003..0.003 rows=1 loops=978)

  • Index Cond: (id = qg.user_id)
  • Filter: (status = ANY ('{invited,active}'::user_status[]))
  • Rows Removed by Filter: 0
22. 11.676 11.676 ↑ 1.0 1 973

Index Scan using questionnaire_pkey on questionnaire q (cost=0.28..3.63 rows=1 width=43) (actual time=0.012..0.012 rows=1 loops=973)

  • Index Cond: (id = qg.questionnaire_id)
23. 2.919 2.919 ↑ 1.0 1 973

Index Scan using user_pkey on "user" user_3 (cost=0.29..0.36 rows=1 width=88) (actual time=0.003..0.003 rows=1 loops=973)

  • Index Cond: (id = qr.user_id)
  • Filter: (status = ANY ('{invited,active}'::user_status[]))
  • Rows Removed by Filter: 0
Planning time : 42.976 ms
Execution time : 862.090 ms