explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Tuur

Settings
# exclusive inclusive rows x rows loops node
1. 253.520 4,705.339 ↑ 9,849,957.4 8 1

Hash Join (cost=468,114.84..3,951,595.24 rows=78,799,659 width=757) (actual time=4,065.075..4,705.339 rows=8 loops=1)

  • Hash Cond: (wfelt.lead_time_id = wftlt.lead_time_id)
2. 638.935 4,448.537 ↓ 2.4 1,808,340 1

Hash Left Join (cost=467,805.46..549,745.97 rows=747,230 width=644) (actual time=192.579..4,448.537 rows=1,808,340 loops=1)

  • Hash Cond: (bin.currency_id = cy.id)
3. 651.802 3,809.543 ↓ 2.4 1,808,340 1

Hash Left Join (cost=467,803.14..547,641.26 rows=747,230 width=628) (actual time=192.484..3,809.543 rows=1,808,340 loops=1)

  • Hash Cond: (bin.status_id = ets.id)
4. 636.013 3,155.211 ↓ 2.4 1,808,340 1

Hash Left Join (cost=467,631.26..545,506.13 rows=747,230 width=614) (actual time=189.915..3,155.211 rows=1,808,340 loops=1)

  • Hash Cond: (bin.tier_id = t.id)
5. 653.946 2,519.166 ↓ 2.4 1,808,340 1

Hash Join (cost=467,629.41..543,326.34 rows=747,230 width=102) (actual time=189.869..2,519.166 rows=1,808,340 loops=1)

  • Hash Cond: (bin.relation_id = re.id)
6. 1,219.934 1,864.992 ↓ 2.4 1,808,340 1

Hash Join (cost=467,604.43..541,319.05 rows=747,230 width=84) (actual time=189.629..1,864.992 rows=1,808,340 loops=1)

  • Hash Cond: (wfelt.entity_id = bin.id)
7. 461.736 605.618 ↑ 1.0 1,822,917 1

Bitmap Heap Scan on work_flow_entity_lead_time wfelt (cost=34,386.60..103,277.94 rows=1,836,667 width=8) (actual time=150.171..605.618 rows=1,822,917 loops=1)

  • Recheck Cond: (entity_type_id = 67)
  • Heap Blocks: exact=27786
8. 143.882 143.882 ↑ 1.0 1,822,917 1

Bitmap Index Scan on idx_work_flow_entity_lead_time_entity (cost=0.00..33,927.44 rows=1,836,667 width=0) (actual time=143.882..143.882 rows=1,822,917 loops=1)

  • Index Cond: (entity_type_id = 67)
9. 3.739 39.440 ↓ 2.0 8,232 1

Hash (cost=433,166.38..433,166.38 rows=4,116 width=84) (actual time=39.440..39.440 rows=8,232 loops=1)

  • Buckets: 16384 (originally 8192) Batches: 1 (originally 1) Memory Usage: 1007kB
10. 18.500 35.701 ↓ 2.0 8,232 1

Index Scan using line_item_client_id_indx on base_invoice bin (cost=0.29..433,166.38 rows=4,116 width=84) (actual time=12.887..35.701 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
11.          

SubPlan (forIndex Scan)

12. 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)
13. 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)
14. 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))
15. 0.000 0.010 ↓ 0.0 0 1

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

16. 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
17. 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)
18. 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)
19. 0.016 0.016 ↓ 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.016..0.016 rows=0 loops=1)

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

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

21. 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)
22. 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
23. 4.596 10.291 ↓ 1.6 8,247 1

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

  • Hash Cond: (et_1.contract_id = udr_3.entity_id)
24. 3.347 3.347 ↑ 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..3.347 rows=8,460 loops=1)

25. 0.201 2.348 ↓ 1.1 971 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 43kB
26. 2.030 2.147 ↓ 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.172..2.147 rows=971 loops=1)

  • Recheck Cond: ((user_id = 1257) AND (entity_type_id = 61))
  • Heap Blocks: exact=379
27. 0.117 0.117 ↓ 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.117..0.117 rows=973 loops=1)

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

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

29. 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)
30. 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
31. 4.825 6.884 ↓ 7.8 8,353 1

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

  • Hash Cond: (et_3.relation_id = udr_5.entity_id)
32. 1.448 1.448 ↑ 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.003..1.448 rows=8,460 loops=1)

33. 0.053 0.611 ↓ 1.7 262 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
34. 0.527 0.558 ↓ 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.050..0.558 rows=262 loops=1)

  • Recheck Cond: ((user_id = 1257) AND (entity_type_id = 1))
  • Heap Blocks: exact=106
35. 0.031 0.031 ↓ 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.031..0.031 rows=262 loops=1)

  • Index Cond: ((user_id = 1257) AND (entity_type_id = 1))
36. 0.089 0.228 ↑ 1.0 399 1

Hash (cost=19.99..19.99 rows=399 width=22) (actual time=0.228..0.228 rows=399 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 30kB
37. 0.139 0.139 ↑ 1.0 399 1

Seq Scan on relation re (cost=0.00..19.99 rows=399 width=22) (actual time=0.009..0.139 rows=399 loops=1)

38. 0.011 0.032 ↑ 1.0 38 1

Hash (cost=1.38..1.38 rows=38 width=520) (actual time=0.032..0.032 rows=38 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
39. 0.021 0.021 ↑ 1.0 38 1

Seq Scan on tier t (cost=0.00..1.38 rows=38 width=520) (actual time=0.014..0.021 rows=38 loops=1)

40. 1.293 2.530 ↑ 1.0 4,661 1

Hash (cost=113.61..113.61 rows=4,661 width=22) (actual time=2.530..2.530 rows=4,661 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 322kB
41. 1.237 1.237 ↑ 1.0 4,661 1

Seq Scan on work_flow_status ets (cost=0.00..113.61 rows=4,661 width=22) (actual time=0.009..1.237 rows=4,661 loops=1)

42. 0.032 0.059 ↓ 1.1 66 1

Hash (cost=1.59..1.59 rows=59 width=24) (actual time=0.059..0.059 rows=66 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
43. 0.027 0.027 ↓ 1.1 66 1

Seq Scan on currency cy (cost=0.00..1.59 rows=59 width=24) (actual time=0.016..0.027 rows=66 loops=1)

44. 0.720 3.282 ↑ 1.0 3,781 1

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

  • Buckets: 4096 Batches: 1 Memory Usage: 165kB
45. 2.562 2.562 ↑ 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.022..2.562 rows=3,781 loops=1)

  • Filter: (lead_time_type = 3)
  • Rows Removed by Filter: 4548