explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QGg7

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 3,431.642 ↑ 1,372.0 3 1

Nested Loop Left Join (cost=310.93..439,341.74 rows=4,116 width=761) (actual time=3,429.392..3,431.642 rows=3 loops=1)

2. 0.002 3,431.624 ↑ 1,372.0 3 1

Nested Loop Left Join (cost=310.79..438,579.93 rows=4,116 width=624) (actual time=3,429.379..3,431.624 rows=3 loops=1)

3. 0.002 3,431.604 ↑ 1,372.0 3 1

Nested Loop Left Join (cost=310.50..437,017.22 rows=4,116 width=610) (actual time=3,429.364..3,431.604 rows=3 loops=1)

4. 0.004 3,431.584 ↑ 1,372.0 3 1

Nested Loop Left Join (cost=310.23..435,743.95 rows=4,116 width=592) (actual time=3,429.349..3,431.584 rows=3 loops=1)

5. 6.185 3,431.565 ↑ 1,372.0 3 1

Nested Loop Semi Join (cost=310.09..435,085.70 rows=4,116 width=80) (actual time=3,429.334..3,431.565 rows=3 loops=1)

6. 40.974 58.492 ↓ 2.0 8,232 1

Index Scan using idx_base_invoice_cltid_cltseqid on base_invoice bin (cost=0.29..434,123.40 rows=4,116 width=84) (actual time=23.274..58.492 rows=8,232 loops=1)

  • Index Cond: (client_id = 1005)
  • Filter: ((NOT deleted) AND (NOT saved_as_draft) AND COALESCE(NULLIF((alternatives: SubPlan 1 or hashed SubPlan 2), false), NULLIF((alternatives: SubPlan 3 or hashed SubPlan 4), false), NULLIF((alternatives: SubPlan 5 or hashed SubPlan 6), false), NULLIF((alternatives: SubPlan 7 or hashed SubPlan 8), false)))
  • Rows Removed by Filter: 133
7.          

SubPlan (forIndex Scan)

8. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.42..9.56 rows=1 width=0) (never executed)

  • Join Filter: (sda.data_id = ed.id)
9. 0.000 0.000 ↓ 0.0 0

Seq Scan on secondary_data_access sda (cost=0.00..1.11 rows=1 width=4) (never executed)

  • Filter: (user_id = 1257)
10. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_entity_data_entity_type_id_entity_id on entity_data ed (cost=0.42..8.44 rows=1 width=4) (never executed)

  • Index Cond: ((bin.entity_type_id = entity_type_id) AND (bin.entity_id = entity_id))
11. 0.001 0.011 ↓ 0.0 0 1

Nested Loop (cost=0.42..9.55 rows=1 width=8) (actual time=0.011..0.011 rows=0 loops=1)

12. 0.010 0.010 ↓ 0.0 0 1

Seq Scan on secondary_data_access sda_1 (cost=0.00..1.11 rows=1 width=4) (actual time=0.010..0.010 rows=0 loops=1)

  • Filter: (user_id = 1257)
  • Rows Removed by Filter: 9
13. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_entity_data on entity_data ed_1 (cost=0.42..8.44 rows=1 width=12) (never executed)

  • Index Cond: (id = sda_1.data_id)
14. 0.000 0.000 ↓ 0.0 0

Index Scan using user_data_read_access_entity_details on user_data_read_access udr (cost=0.42..8.45 rows=1 width=0) (never executed)

  • Index Cond: ((entity_type_id = 67) AND (entity_id = bin.id))
  • Filter: (user_id = 1257)
15. 0.017 0.017 ↓ 0.0 0 1

Index Scan using user_data_read_access_entity_details on user_data_read_access udr_1 (cost=0.42..8.45 rows=1 width=4) (actual time=0.017..0.017 rows=0 loops=1)

  • Index Cond: (entity_type_id = 67)
  • Filter: (user_id = 1257)
16. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.71..16.77 rows=1 width=0) (never executed)

17. 0.000 0.000 ↓ 0.0 0

Index Scan using base_invoice_pkey on base_invoice et (cost=0.29..8.30 rows=1 width=4) (never executed)

  • Index Cond: (id = bin.id)
18. 0.000 0.000 ↓ 0.0 0

Index Only Scan using user_data_read_access_uk1 on user_data_read_access udr_2 (cost=0.42..8.45 rows=1 width=4) (never executed)

  • Index Cond: ((user_id = 1257) AND (entity_type_id = 61) AND (entity_id = et.contract_id))
  • Heap Fetches: 0
19. 5.367 9.991 ↓ 1.6 8,247 1

Hash Join (cost=2,341.00..3,205.88 rows=5,128 width=4) (actual time=2.600..9.991 rows=8,247 loops=1)

  • Hash Cond: (et_1.contract_id = udr_3.entity_id)
20. 2.045 2.045 ↑ 1.0 8,460 1

Seq Scan on base_invoice et_1 (cost=0.00..842.60 rows=8,460 width=8) (actual time=0.003..2.045 rows=8,460 loops=1)

21. 0.243 2.579 ↓ 1.1 971 1

Hash (cost=2,329.87..2,329.87 rows=891 width=4) (actual time=2.579..2.579 rows=971 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 43kB
22. 2.189 2.336 ↓ 1.1 971 1

Bitmap Heap Scan on user_data_read_access udr_3 (cost=21.56..2,329.87 rows=891 width=4) (actual time=0.207..2.336 rows=971 loops=1)

  • Recheck Cond: ((user_id = 1257) AND (entity_type_id = 61))
  • Heap Blocks: exact=379
23. 0.147 0.147 ↓ 1.1 973 1

Bitmap Index Scan on user_data_read_access_1 (cost=0.00..21.34 rows=891 width=0) (actual time=0.147..0.147 rows=973 loops=1)

  • Index Cond: ((user_id = 1257) AND (entity_type_id = 61))
24. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.71..16.86 rows=1 width=0) (never executed)

25. 0.000 0.000 ↓ 0.0 0

Index Scan using base_invoice_pkey on base_invoice et_2 (cost=0.29..8.30 rows=1 width=4) (never executed)

  • Index Cond: (id = bin.id)
26. 0.000 0.000 ↓ 0.0 0

Index Only Scan using user_data_read_access_uk1 on user_data_read_access udr_4 (cost=0.42..8.45 rows=1 width=4) (never executed)

  • Index Cond: ((user_id = 1257) AND (entity_type_id = 1) AND (entity_id = et_2.relation_id))
  • Heap Fetches: 0
27. 5.130 7.499 ↓ 7.8 8,353 1

Hash Join (cost=529.83..1,394.72 rows=1,072 width=4) (actual time=0.791..7.499 rows=8,353 loops=1)

  • Hash Cond: (et_3.relation_id = udr_5.entity_id)
28. 1.598 1.598 ↑ 1.0 8,460 1

Seq Scan on base_invoice et_3 (cost=0.00..842.60 rows=8,460 width=8) (actual time=0.007..1.598 rows=8,460 loops=1)

29. 0.056 0.771 ↓ 1.7 262 1

Hash (cost=527.94..527.94 rows=151 width=4) (actual time=0.771..0.771 rows=262 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
30. 0.676 0.715 ↓ 1.7 262 1

Bitmap Heap Scan on user_data_read_access udr_5 (cost=5.97..527.94 rows=151 width=4) (actual time=0.061..0.715 rows=262 loops=1)

  • Recheck Cond: ((user_id = 1257) AND (entity_type_id = 1))
  • Heap Blocks: exact=106
31. 0.039 0.039 ↓ 1.7 262 1

Bitmap Index Scan on user_data_read_access_1 (cost=0.00..5.93 rows=151 width=0) (actual time=0.039..0.039 rows=262 loops=1)

  • Index Cond: ((user_id = 1257) AND (entity_type_id = 1))
32. 276.600 3,366.888 ↓ 0.0 0 8,232

Hash Join (cost=309.81..708.42 rows=19,193 width=4) (actual time=0.409..0.409 rows=0 loops=8,232)

  • Hash Cond: (wfelt.lead_time_id = wftlt.lead_time_id)
33. 3,087.000 3,087.000 ↓ 1.2 220 8,232

Index Scan using idx_work_flow_entity_lead_time_entity on work_flow_entity_lead_time wfelt (cost=0.43..50.37 rows=182 width=8) (actual time=0.009..0.375 rows=220 loops=8,232)

  • Index Cond: ((entity_type_id = 67) AND (entity_id = bin.id))
34. 0.737 3.288 ↑ 1.0 3,781 1

Hash (cost=262.11..262.11 rows=3,781 width=4) (actual time=3.288..3.288 rows=3,781 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 165kB
35. 2.551 2.551 ↑ 1.0 3,781 1

Seq Scan on work_flow_task_lead_time wftlt (cost=0.00..262.11 rows=3,781 width=4) (actual time=0.016..2.551 rows=3,781 loops=1)

  • Filter: (lead_time_type = 3)
  • Rows Removed by Filter: 4548
36. 0.015 0.015 ↑ 1.0 1 3

Index Scan using pk_tier on tier t (cost=0.14..0.16 rows=1 width=520) (actual time=0.005..0.005 rows=1 loops=3)

  • Index Cond: (id = bin.tier_id)
37. 0.018 0.018 ↑ 1.0 1 3

Index Scan using pk_relation on relation re (cost=0.27..0.31 rows=1 width=22) (actual time=0.006..0.006 rows=1 loops=3)

  • Index Cond: (bin.relation_id = id)
38. 0.018 0.018 ↑ 1.0 1 3

Index Scan using pk_work_flow_status on work_flow_status ets (cost=0.28..0.38 rows=1 width=22) (actual time=0.006..0.006 rows=1 loops=3)

  • Index Cond: (bin.status_id = id)
39. 0.012 0.012 ↑ 1.0 1 3

Index Scan using pk_currency on currency cy (cost=0.14..0.16 rows=1 width=24) (actual time=0.004..0.004 rows=1 loops=3)

  • Index Cond: (bin.currency_id = id)