explain.depesz.com

PostgreSQL's explain analyze made readable

Result: V9PU

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 755.325 ↑ 1.0 1 1

Sort (cost=1,262.98..1,262.98 rows=1 width=146) (actual time=755.324..755.325 rows=1 loops=1)

  • Sort Key: client_documents.id
  • Sort Method: quicksort Memory: 25kB
2. 0.004 755.315 ↑ 1.0 1 1

Nested Loop Semi Join (cost=1,235.50..1,262.97 rows=1 width=146) (actual time=755.312..755.315 rows=1 loops=1)

3. 0.005 755.297 ↑ 1.0 1 1

Nested Loop (cost=1,234.64..1,247.34 rows=1 width=150) (actual time=755.296..755.297 rows=1 loops=1)

4. 0.006 755.276 ↑ 1.0 1 1

HashAggregate (cost=1,234.22..1,234.23 rows=1 width=4) (actual time=755.276..755.276 rows=1 loops=1)

  • Group Key: client_documents_1.client_id
5. 0.005 755.270 ↑ 1.0 1 1

Limit (cost=1.28..1,234.20 rows=1 width=12) (actual time=755.266..755.270 rows=1 loops=1)

6. 16.627 755.265 ↑ 408.0 1 1

Nested Loop Semi Join (cost=1.28..503,033.10 rows=408 width=12) (actual time=755.265..755.265 rows=1 loops=1)

7. 624.176 624.176 ↑ 1.2 19,077 1

Index Scan using document_file_pkey on client_documents client_documents_1 (cost=0.43..159,604.05 rows=21,974 width=12) (actual time=0.018..624.176 rows=19,077 loops=1)

  • Filter: (((status)::text = 'processing'::text) AND ((employee_id IS NULL) OR (employee_id = 2) OR (updated_at < '2019-11-07 15:01:47'::timestamp without time zone)) AND ((type)::text = ANY ('{face,pasid,face_with_pasid,driver,face_with_driver,prcid,prcid_back,face_with_prcid,police,face_with_police,postal,postal_back,face_with_postal,voter,face_with_voter,philid,face_with_philid,multi,face_with_multi,sss,face_with_sss,scc,scc_back,face_with_scc,gsisid,face_with_gsisid,tin,face_with_tin}'::text[])))
  • Rows Removed by Filter: 1684826
8. 0.000 114.462 ↓ 0.0 0 19,077

Nested Loop Semi Join (cost=0.85..15.62 rows=1 width=4) (actual time=0.006..0.006 rows=0 loops=19,077)

9. 114.462 114.462 ↓ 0.0 0 19,077

Index Scan using fk_application_client1_idx on applications applications_1 (cost=0.43..8.57 rows=1 width=8) (actual time=0.006..0.006 rows=0 loops=19,077)

  • Index Cond: (client_id = client_documents_1.client_id)
  • Filter: ((state)::text = 'signed'::text)
  • Rows Removed by Filter: 4
10. 0.123 0.123 ↓ 0.0 0 41

Index Scan using application_id on scoring_result scoring_result_1 (cost=0.43..7.04 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=41)

  • Index Cond: (application_id = applications_1.id)
  • Filter: ((decision)::text = 'approved'::text)
  • Rows Removed by Filter: 1
11. 0.016 0.016 ↑ 1.0 1 1

Index Scan using document_file_client_id_index on client_documents (cost=0.43..13.10 rows=1 width=146) (actual time=0.016..0.016 rows=1 loops=1)

  • Index Cond: (client_id = client_documents_1.client_id)
  • Filter: (((status)::text = 'processing'::text) AND ((employee_id IS NULL) OR (employee_id = 2) OR (updated_at < '2019-11-07 15:01:47'::timestamp without time zone)) AND ((type)::text = ANY ('{face,pasid,face_with_pasid,driver,face_with_driver,prcid,prcid_back,face_with_prcid,police,face_with_police,postal,postal_back,face_with_postal,voter,face_with_voter,philid,face_with_philid,multi,face_with_multi,sss,face_with_sss,scc,scc_back,face_with_scc,gsisid,face_with_gsisid,tin,face_with_tin}'::text[])))
12. 0.004 0.014 ↑ 1.0 1 1

Nested Loop Semi Join (cost=0.85..15.62 rows=1 width=4) (actual time=0.013..0.014 rows=1 loops=1)

13. 0.005 0.005 ↑ 1.0 1 1

Index Scan using fk_application_client1_idx on applications (cost=0.43..8.57 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (client_id = client_documents.client_id)
  • Filter: ((state)::text = 'signed'::text)
14. 0.005 0.005 ↑ 1.0 1 1

Index Scan using application_id on scoring_result (cost=0.43..7.04 rows=1 width=4) (actual time=0.004..0.005 rows=1 loops=1)

  • Index Cond: (application_id = applications.id)
  • Filter: ((decision)::text = 'approved'::text)
Planning time : 3.017 ms
Execution time : 755.429 ms