explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 298K

Settings
# exclusive inclusive rows x rows loops node
1. 0.148 3,978.671 ↑ 1.0 100 1

Limit (cost=189,125.90..275,262.08 rows=100 width=5,512) (actual time=3,863.945..3,978.671 rows=100 loops=1)

2. 29.689 3,978.523 ↑ 9.9 100 1

Nested Loop Left Join (cost=189,125.90..1,039,290.04 rows=987 width=5,512) (actual time=3,863.944..3,978.523 rows=100 loops=1)

3. 0.267 3,232.014 ↑ 9.9 100 1

Nested Loop Left Join (cost=189,125.48..435,567.60 rows=987 width=4,233) (actual time=3,189.026..3,232.014 rows=100 loops=1)

4. 0.915 3,230.247 ↑ 9.9 100 1

Merge Right Join (cost=189,125.06..428,564.39 rows=987 width=4,182) (actual time=3,188.996..3,230.247 rows=100 loops=1)

  • Merge Cond: ((sf_acc.id)::text = (sf_opps.account_id)::text)
5. 0.730 592.170 ↑ 182.8 578 1

Merge Left Join (cost=12,954.45..74,208.67 rows=105,641 width=39) (actual time=590.005..592.170 rows=578 loops=1)

  • Merge Cond: ((sf_acc.id)::text = (sf_calllogs_accepted.placetel_account_c)::text)
6. 1.436 1.436 ↑ 182.8 578 1

Index Scan using account_pkey on account sf_acc (cost=0.42..60,878.81 rows=105,641 width=42) (actual time=0.014..1.436 rows=578 loops=1)

7. 85.438 590.004 ↑ 338.5 22 1

Sort (cost=12,954.03..12,972.65 rows=7,448 width=35) (actual time=589.986..590.004 rows=22 loops=1)

  • Sort Key: sf_calllogs_accepted.placetel_account_c
  • Sort Method: quicksort Memory: 1,290kB
8. 4.558 504.566 ↓ 1.6 11,587 1

Subquery Scan on sf_calllogs_accepted (cost=12,326.07..12,475.03 rows=7,448 width=35) (actual time=495.441..504.566 rows=11,587 loops=1)

9. 71.347 500.008 ↓ 1.6 11,587 1

HashAggregate (cost=12,326.07..12,400.55 rows=7,448 width=43) (actual time=495.440..500.008 rows=11,587 loops=1)

  • Group Key: calllogs_accepted.placetel_account_c
10. 428.661 428.661 ↓ 1.0 147,577 1

Seq Scan on placetel_placetel_call_log_c calllogs_accepted (cost=0.00..11,222.83 rows=147,099 width=27) (actual time=0.460..428.661 rows=147,577 loops=1)

  • Filter: ((placetel_status_c)::text = 'Accepted'::text)
  • Rows Removed by Filter: 2,618
11. 0.537 2,637.162 ↑ 9.9 100 1

Materialize (cost=176,170.03..354,079.28 rows=987 width=4,162) (actual time=2,598.968..2,637.162 rows=100 loops=1)

12. 0.209 2,636.625 ↑ 9.9 100 1

Merge Left Join (cost=176,170.03..354,076.82 rows=987 width=4,162) (actual time=2,598.958..2,636.625 rows=100 loops=1)

  • Merge Cond: ((sf_opps.account_id)::text = (sf_accounts_1.id)::text)
13. 7.120 40.787 ↑ 9.9 100 1

Nested Loop Left Join (cost=9.72..174,938.33 rows=987 width=4,143) (actual time=3.488..40.787 rows=100 loops=1)

  • Join Filter: ((sf_opps.travel_country_primary_c)::text = sf_country.name)
  • Rows Removed by Join Filter: 24,697
14. 0.119 28.367 ↑ 9.9 100 1

Nested Loop Left Join (cost=9.72..171,260.59 rows=987 width=4,106) (actual time=3.255..28.367 rows=100 loops=1)

15. 0.181 27.248 ↑ 9.9 100 1

Nested Loop Left Join (cost=9.43..168,157.68 rows=987 width=3,920) (actual time=3.241..27.248 rows=100 loops=1)

16. 12.089 24.667 ↑ 9.9 100 1

Nested Loop Left Join (cost=9.15..165,054.78 rows=987 width=3,734) (actual time=3.220..24.667 rows=100 loops=1)

17. 2.942 11.278 ↑ 9.9 100 1

Nested Loop Left Join (cost=0.42..152,496.66 rows=987 width=3,722) (actual time=2.470..11.278 rows=100 loops=1)

  • Join Filter: ((sf_opps.owner_id)::text = (sf_user.id)::text)
  • Rows Removed by Join Filter: 9,870
18. 3.436 3.436 ↑ 9.9 100 1

Index Scan using acc_id_idx on opportunity sf_opps (cost=0.42..150,980.91 rows=987 width=3,664) (actual time=0.044..3.436 rows=100 loops=1)

  • Filter: ((is_deleted IS NOT TRUE) AND ((tps_lead_c IS TRUE) OR ((nezasa_template_id_c IS NOT NULL) AND (initial_inquiry_profile_c IS NULL))) AND ((strpos((loss_reason_c)::text, 'Testanfrage'::text) IS NULL) OR (strpos((loss_reason_c)::text, 'Testanfrage'::text) = 0)))
  • Rows Removed by Filter: 546
19. 2.139 4.900 ↑ 1.0 100 100

Materialize (cost=0.00..35.50 rows=100 width=77) (actual time=0.000..0.049 rows=100 loops=100)

20. 2.761 2.761 ↑ 1.0 100 1

Seq Scan on "user" sf_user (cost=0.00..35.00 rows=100 width=77) (actual time=0.009..2.761 rows=100 loops=1)

21. 0.000 1.300 ↓ 0.0 0 100

Index Scan using event_id_idx on event sf_event (cost=8.73..12.71 rows=1 width=31) (actual time=0.013..0.013 rows=0 loops=100)

  • Index Cond: ((id)::text = (SubPlan 27))
22.          

SubPlan (for Index Scan)

23. 0.200 11.800 ↑ 1.0 1 100

Aggregate (cost=8.31..8.32 rows=1 width=32) (actual time=0.118..0.118 rows=1 loops=100)

24. 11.600 11.600 ↓ 0.0 0 100

Index Scan using event_what_id_idx on event sf_event_1 (cost=0.29..8.31 rows=1 width=19) (actual time=0.098..0.116 rows=0 loops=100)

  • Index Cond: ((sf_opps.id)::text = (what_id)::text)
  • Filter: ((is_deleted IS FALSE) AND ((type)::text = 'Call'::text))
25. 2.400 2.400 ↓ 0.0 0 100

Index Scan using net_promoter_score_c_opportunity_c_idx on net_promoter_score_c sf_nps_call (cost=0.29..3.13 rows=1 width=205) (actual time=0.024..0.024 rows=0 loops=100)

  • Index Cond: ((sf_opps.id)::text = (opportunity_c)::text)
  • Filter: ((name)::text = 'Closed opportunity'::text)
  • Rows Removed by Filter: 0
26. 1.000 1.000 ↓ 0.0 0 100

Index Scan using net_promoter_score_c_opportunity_c_idx on net_promoter_score_c sf_nps_trip (cost=0.29..3.13 rows=1 width=205) (actual time=0.010..0.010 rows=0 loops=100)

  • Index Cond: ((sf_opps.id)::text = (opportunity_c)::text)
  • Filter: ((name)::text = 'End of trip'::text)
  • Rows Removed by Filter: 0
27. 5.186 5.300 ↑ 1.0 248 100

Materialize (cost=0.00..6.72 rows=248 width=48) (actual time=0.001..0.053 rows=248 loops=100)

28. 0.114 0.114 ↑ 1.0 248 1

Seq Scan on countries sf_country (cost=0.00..5.48 rows=248 width=48) (actual time=0.016..0.114 rows=248 loops=1)

29. 0.007 2,595.629 ↑ 7,029.8 15 1

Materialize (cost=176,160.31..178,862.53 rows=105,447 width=19) (actual time=2,595.463..2,595.629 rows=15 loops=1)

30. 0.030 2,595.622 ↑ 35,149.0 3 1

Unique (cost=176,160.31..177,544.45 rows=105,447 width=19) (actual time=2,595.461..2,595.622 rows=3 loops=1)

31. 774.571 2,595.592 ↑ 2,768.3 100 1

Sort (cost=176,160.31..176,852.38 rows=276,827 width=19) (actual time=2,595.459..2,595.592 rows=100 loops=1)

  • Sort Key: sf_accounts_1.id
  • Sort Method: external merge Disk: 3,272kB
32. 408.634 1,821.021 ↑ 2.4 115,620 1

Hash Join (cost=60,860.90..145,456.55 rows=276,827 width=19) (actual time=439.769..1,821.021 rows=115,620 loops=1)

  • Hash Cond: (lower((drift_1.from_email)::text) = (sf_accounts_1.person_email)::text)
  • Join Filter: (to_timestamp(((((drift_1.created_at)::double precision / '1000'::double precision))::integer)::double precision) >= sf_opps_1_1.created_date)
  • Rows Removed by Join Filter: 52,778
33. 975.293 975.293 ↓ 1.0 720,049 1

Seq Scan on conversation_messages drift_1 (cost=0.00..33,327.92 rows=717,626 width=36) (actual time=0.353..975.293 rows=720,049 loops=1)

  • Filter: (body IS NOT NULL)
  • Rows Removed by Filter: 121,450
34. 55.293 437.094 ↓ 1.0 121,707 1

Hash (cost=58,271.79..58,271.79 rows=121,609 width=48) (actual time=437.093..437.094 rows=121,707 loops=1)

  • Buckets: 65,536 Batches: 4 Memory Usage: 3,027kB
35. 112.423 381.801 ↓ 1.0 121,707 1

Hash Join (cost=17,226.50..58,271.79 rows=121,609 width=48) (actual time=153.627..381.801 rows=121,707 loops=1)

  • Hash Cond: ((sf_opps_1_1.account_id)::text = (sf_accounts_1.id)::text)
36. 116.053 116.053 ↑ 1.0 121,731 1

Seq Scan on opportunity sf_opps_1_1 (cost=0.00..36,882.33 rows=121,833 width=27) (actual time=0.007..116.053 rows=121,731 loops=1)

37. 48.241 153.325 ↓ 1.0 106,285 1

Hash (cost=15,084.41..15,084.41 rows=105,447 width=40) (actual time=153.325..153.325 rows=106,285 loops=1)

  • Buckets: 65,536 Batches: 4 Memory Usage: 2,419kB
38. 105.084 105.084 ↓ 1.0 106,285 1

Seq Scan on account sf_accounts_1 (cost=0.00..15,084.41 rows=105,447 width=40) (actual time=0.009..105.084 rows=106,285 loops=1)

  • Filter: (is_deleted IS FALSE)
  • Rows Removed by Filter: 190
39. 1.500 1.500 ↑ 1.0 1 100

Index Scan using account_pkey on account sf_accounts (cost=0.42..7.09 rows=1 width=70) (actual time=0.015..0.015 rows=1 loops=100)

  • Index Cond: ((sf_opps.account_id)::text = (id)::text)
40. 4.400 4.400 ↑ 1.0 1 100

Index Scan using opp_nr_idx on opportunity sf_opps_1 (cost=0.42..6.75 rows=1 width=91) (actual time=0.044..0.044 rows=1 loops=100)

  • Index Cond: ((opportunity_nr_c)::text = (sf_opps.opportunity_nr_c)::text)
  • Filter: ((account_id)::text = (sf_opps.account_id)::text)
41.          

SubPlan (for Nested Loop Left Join)

42. 0.300 24.400 ↑ 1.0 1 100

Limit (cost=28.34..28.34 rows=1 width=19) (actual time=0.242..0.244 rows=1 loops=100)

43. 0.500 24.100 ↑ 3.0 1 100

Sort (cost=28.34..28.35 rows=3 width=19) (actual time=0.241..0.241 rows=1 loops=100)

  • Sort Key: opp_stages.created_date DESC
  • Sort Method: quicksort Memory: 25kB
44. 23.600 23.600 ↑ 1.5 2 100

Index Scan using opp_id_idx on opportunity_history opp_stages (cost=0.42..28.32 rows=3 width=19) (actual time=0.219..0.236 rows=2 loops=100)

  • Index Cond: ((opportunity_id)::text = (sf_opps.id)::text)
  • Filter: ((stage_name)::text <> 'Closed Lost'::text)
  • Rows Removed by Filter: 2
45. 1.125 1.125 ↓ 0.0 0 75

Index Scan using opp_id_idx on opportunity_history opp_stages_1 (cost=0.42..28.38 rows=2 width=0) (actual time=0.015..0.015 rows=0 loops=75)

  • Index Cond: ((opportunity_id)::text = (sf_opps.id)::text)
  • Filter: (((stage_name)::text <> 'Closed Lost'::text) AND ((stage_name)::text <> 'Neu'::text) AND ((stage_name)::text <> 'Erstkontakt (SPARK)'::text) AND ((stage_name)::text <> 'Anfrage verifizieren (1%)'::text) AND ((stage_name)::text <> 'Anfrage verifizieren'::text))
  • Rows Removed by Filter: 3
46. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.84..56.67 rows=1 width=0) (never executed)

  • Join Filter: (opp_his_rev.created_date > opp_stages_rev_sent.created_date)
47. 0.000 0.000 ↓ 0.0 0

Index Scan using opp_id_idx on opportunity_history opp_his_rev (cost=0.42..28.33 rows=1 width=27) (never executed)

  • Index Cond: ((opportunity_id)::text = (sf_opps.id)::text)
  • Filter: ((stage_name)::text = ANY ('{"Angebot überarbeiten","Buchung abschließen","Closed Won"}'::text[]))
48. 0.000 0.000 ↓ 0.0 0

Index Scan using opp_id_idx on opportunity_history opp_stages_rev_sent (cost=0.42..28.32 rows=1 width=27) (never executed)

  • Index Cond: ((opportunity_id)::text = (sf_opps.id)::text)
  • Filter: ((stage_name)::text = 'Überarbeitung versendet'::text)
49. 19.193 599.468 ↓ 16.4 21,825 1

Hash Join (cost=18,085.89..36,719.28 rows=1,332 width=32) (actual time=500.426..599.468 rows=21,825 loops=1)

  • Hash Cond: ((opp_stages_rev_sent_1.opportunity_id)::text = (opp_his_rev_1.opportunity_id)::text)
  • Join Filter: (opp_his_rev_1.created_date > opp_stages_rev_sent_1.created_date)
  • Rows Removed by Join Filter: 39,146
50. 80.611 80.611 ↑ 1.1 10,640 1

Seq Scan on opportunity_history opp_stages_rev_sent_1 (cost=0.00..17,157.42 rows=11,641 width=27) (actual time=0.707..80.611 rows=10,640 loops=1)

  • Filter: ((stage_name)::text = 'Überarbeitung versendet'::text)
  • Rows Removed by Filter: 473,763
51. 13.591 499.664 ↓ 1.3 32,556 1

Hash (cost=17,760.37..17,760.37 rows=26,042 width=27) (actual time=499.663..499.664 rows=32,556 loops=1)

  • Buckets: 32,768 Batches: 1 Memory Usage: 2,291kB
52. 486.073 486.073 ↓ 1.3 32,556 1

Seq Scan on opportunity_history opp_his_rev_1 (cost=0.00..17,760.37 rows=26,042 width=27) (actual time=0.016..486.073 rows=32,556 loops=1)

  • Filter: ((stage_name)::text = ANY ('{"Angebot überarbeiten","Buchung abschließen","Closed Won"}'::text[]))
  • Rows Removed by Filter: 451,847
53. 0.075 1.500 ↓ 0.0 0 75

Limit (cost=28.39..28.41 rows=1 width=16) (actual time=0.020..0.020 rows=0 loops=75)

54. 0.075 1.425 ↓ 0.0 0 75

GroupAggregate (cost=28.39..28.43 rows=2 width=16) (actual time=0.019..0.019 rows=0 loops=75)

  • Group Key: opp_stages_2.created_date
55. 0.225 1.350 ↓ 0.0 0 75

Sort (cost=28.39..28.40 rows=2 width=8) (actual time=0.018..0.018 rows=0 loops=75)

  • Sort Key: opp_stages_2.created_date
  • Sort Method: quicksort Memory: 25kB
56. 1.125 1.125 ↑ 2.0 1 75

Index Scan using opp_id_idx on opportunity_history opp_stages_2 (cost=0.42..28.38 rows=2 width=8) (actual time=0.014..0.015 rows=1 loops=75)

  • Index Cond: ((opportunity_id)::text = (sf_opps.id)::text)
  • Filter: (((stage_name)::text <> 'Closed Lost'::text) AND ((stage_name)::text <> 'Neu'::text) AND ((stage_name)::text <> 'Erstkontakt (SPARK)'::text) AND ((stage_name)::text <> 'Anfrage verifizieren (1%)'::text) AND ((stage_name)::text <> 'Anfrage verifizieren'::text))
  • Rows Removed by Filter: 3
57. 0.100 2.400 ↓ 0.0 0 100

Limit (cost=56.66..56.68 rows=1 width=16) (actual time=0.024..0.024 rows=0 loops=100)

58. 0.100 2.300 ↓ 0.0 0 100

GroupAggregate (cost=56.66..56.68 rows=1 width=16) (actual time=0.023..0.023 rows=0 loops=100)

  • Group Key: opp_stages_3.created_date
59. 0.200 2.200 ↓ 0.0 0 100

Sort (cost=56.66..56.67 rows=1 width=8) (actual time=0.022..0.022 rows=0 loops=100)

  • Sort Key: opp_stages_3.created_date
  • Sort Method: quicksort Memory: 25kB
60. 0.101 2.000 ↓ 0.0 0 100

Nested Loop (cost=0.84..56.65 rows=1 width=8) (actual time=0.017..0.020 rows=0 loops=100)

  • Join Filter: (opp_stages_3.created_date > opp_stages_rev_sent_2.created_date)
  • Rows Removed by Join Filter: 1
61. 1.500 1.500 ↓ 0.0 0 100

Index Scan using opp_id_idx on opportunity_history opp_stages_3 (cost=0.42..28.32 rows=1 width=27) (actual time=0.015..0.015 rows=0 loops=100)

  • Index Cond: ((opportunity_id)::text = (sf_opps.id)::text)
  • Filter: ((stage_name)::text = ANY ('{"Angebot überarbeiten"}'::text[]))
  • Rows Removed by Filter: 4
62. 0.399 0.399 ↓ 4.0 4 19

Index Scan using opp_id_idx on opportunity_history opp_stages_rev_sent_2 (cost=0.42..28.32 rows=1 width=27) (actual time=0.014..0.021 rows=4 loops=19)

  • Index Cond: ((opportunity_id)::text = (sf_opps.id)::text)
  • Filter: ((stage_name)::text = 'Überarbeitung versendet'::text)
  • Rows Removed by Filter: 18
63. 0.000 0.000 ↓ 0.0 0

Index Only Scan using case_opportunity_c_idx on "case" (cost=0.29..8.32 rows=2 width=0) (never executed)

  • Index Cond: (opportunity_c = (sf_opps.id)::text)
  • Heap Fetches: 0
64. 54.144 54.144 ↑ 1.0 20,426 1

Seq Scan on "case" case_1 (cost=0.00..1,675.56 rows=20,856 width=32) (actual time=0.535..54.144 rows=20,426 loops=1)

65. 1.036 1.036 ↓ 0.0 0 74

Index Scan using opp_id_idx on opportunity_history a (cost=0.42..28.33 rows=1 width=0) (actual time=0.014..0.014 rows=0 loops=74)

  • Index Cond: ((opportunity_id)::text = (sf_opps.id)::text)
  • Filter: ((stage_name)::text <> ALL ('{Neu,"Erstkontakt (SPARK)","Closed Lost"}'::text[]))
  • Rows Removed by Filter: 3
66. 0.143 0.143 ↓ 0.0 0 11

Index Scan using opp_id_idx on opportunity_history a_1 (cost=0.42..28.32 rows=4 width=0) (actual time=0.013..0.013 rows=0 loops=11)

  • Index Cond: ((opportunity_id)::text = (sf_opps.id)::text)
  • Filter: ((stage_name)::text <> ALL ('{Neu,"Erstkontakt (SPARK)"}'::text[]))
  • Rows Removed by Filter: 1
67. 3.004 3.004 ↑ 5.0 1 4

Index Only Scan using task_what_id_idx on task a_2 (cost=0.42..8.51 rows=5 width=0) (actual time=0.751..0.751 rows=1 loops=4)

  • Index Cond: (what_id = (sf_opps.id)::text)
  • Heap Fetches: 0
68. 0.300 2.400 ↑ 1.0 1 100

Aggregate (cost=12.46..12.47 rows=1 width=8) (actual time=0.023..0.024 rows=1 loops=100)

69. 2.100 2.100 ↓ 2.0 2 100

Index Scan using acc_id_idx on opportunity p (cost=0.42..12.46 rows=1 width=0) (actual time=0.014..0.021 rows=2 loops=100)

  • Index Cond: ((account_id)::text = (sf_opps.account_id)::text)
  • Filter: ((is_deleted IS FALSE) AND ((opportunity_nr_c)::text <= (sf_opps.opportunity_nr_c)::text))
  • Rows Removed by Filter: 1
70. 0.200 1.400 ↑ 1.0 1 100

Aggregate (cost=12.46..12.47 rows=1 width=8) (actual time=0.013..0.014 rows=1 loops=100)

71. 1.200 1.200 ↓ 0.0 0 100

Index Scan using acc_id_idx on opportunity p_1 (cost=0.42..12.46 rows=1 width=0) (actual time=0.012..0.012 rows=0 loops=100)

  • Index Cond: ((account_id)::text = (sf_opps.account_id)::text)
  • Filter: ((is_won IS TRUE) AND (is_deleted IS FALSE) AND ((opportunity_nr_c)::text <= (sf_opps.opportunity_nr_c)::text))
  • Rows Removed by Filter: 3
72. 0.100 1.300 ↑ 1.0 1 100

Aggregate (cost=12.46..12.47 rows=1 width=8) (actual time=0.013..0.013 rows=1 loops=100)

73. 1.200 1.200 ↓ 0.0 0 100

Index Scan using acc_id_idx on opportunity p_2 (cost=0.42..12.46 rows=1 width=0) (actual time=0.012..0.012 rows=0 loops=100)

  • Index Cond: ((account_id)::text = (sf_opps.account_id)::text)
  • Filter: ((is_won IS TRUE) AND (is_deleted IS FALSE) AND ((opportunity_nr_c)::text <= (sf_opps.opportunity_nr_c)::text))
  • Rows Removed by Filter: 3
74. 0.200 1.700 ↑ 1.0 1 100

Aggregate (cost=28.33..28.34 rows=1 width=8) (actual time=0.016..0.017 rows=1 loops=100)

75. 1.500 1.500 ↓ 0.0 0 100

Index Scan using opp_id_idx on opportunity_history opp_stages_4 (cost=0.42..28.32 rows=2 width=8) (actual time=0.015..0.015 rows=0 loops=100)

  • Index Cond: ((opportunity_id)::text = (sf_opps.id)::text)
  • Filter: ((stage_name)::text = 'Neu'::text)
  • Rows Removed by Filter: 3
76. 0.200 1.600 ↑ 1.0 1 100

Aggregate (cost=28.33..28.34 rows=1 width=8) (actual time=0.015..0.016 rows=1 loops=100)

77. 1.400 1.400 ↑ 1.0 1 100

Index Scan using opp_id_idx on opportunity_history opp_stages_5 (cost=0.42..28.32 rows=1 width=8) (actual time=0.013..0.014 rows=1 loops=100)

  • Index Cond: ((opportunity_id)::text = (sf_opps.id)::text)
  • Filter: ((stage_name)::text = 'Erstkontakt (SPARK)'::text)
  • Rows Removed by Filter: 3
78. 0.100 1.500 ↑ 1.0 1 100

Aggregate (cost=28.33..28.34 rows=1 width=8) (actual time=0.015..0.015 rows=1 loops=100)

79. 1.400 1.400 ↓ 0.0 0 100

Index Scan using opp_id_idx on opportunity_history opp_stages_6 (cost=0.42..28.32 rows=1 width=8) (actual time=0.013..0.014 rows=0 loops=100)

  • Index Cond: ((opportunity_id)::text = (sf_opps.id)::text)
  • Filter: ((stage_name)::text = 'Offer erstellen'::text)
  • Rows Removed by Filter: 4
80. 0.100 1.400 ↑ 1.0 1 100

Aggregate (cost=28.33..28.34 rows=1 width=8) (actual time=0.014..0.014 rows=1 loops=100)

81. 1.300 1.300 ↓ 0.0 0 100

Index Scan using opp_id_idx on opportunity_history opp_stages_7 (cost=0.42..28.32 rows=1 width=8) (actual time=0.013..0.013 rows=0 loops=100)

  • Index Cond: ((opportunity_id)::text = (sf_opps.id)::text)
  • Filter: ((stage_name)::text = 'Freigaben einholen'::text)
  • Rows Removed by Filter: 4
82. 0.100 1.500 ↑ 1.0 1 100

Aggregate (cost=28.33..28.34 rows=1 width=8) (actual time=0.015..0.015 rows=1 loops=100)

83. 1.400 1.400 ↓ 0.0 0 100

Index Scan using opp_id_idx on opportunity_history opp_stages_8 (cost=0.42..28.32 rows=1 width=8) (actual time=0.013..0.014 rows=0 loops=100)

  • Index Cond: ((opportunity_id)::text = (sf_opps.id)::text)
  • Filter: ((stage_name)::text = 'Angebot versendet'::text)
  • Rows Removed by Filter: 4
84. 0.100 1.400 ↑ 1.0 1 100

Aggregate (cost=28.33..28.34 rows=1 width=8) (actual time=0.014..0.014 rows=1 loops=100)

85. 1.300 1.300 ↓ 0.0 0 100

Index Scan using opp_id_idx on opportunity_history opp_stages_9 (cost=0.42..28.32 rows=1 width=8) (actual time=0.013..0.013 rows=0 loops=100)

  • Index Cond: ((opportunity_id)::text = (sf_opps.id)::text)
  • Filter: ((stage_name)::text = 'Angebot überarbeiten'::text)
  • Rows Removed by Filter: 4
86. 0.200 1.500 ↑ 1.0 1 100

Aggregate (cost=28.33..28.34 rows=1 width=8) (actual time=0.014..0.015 rows=1 loops=100)

87. 1.300 1.300 ↓ 0.0 0 100

Index Scan using opp_id_idx on opportunity_history opp_stages_10 (cost=0.42..28.32 rows=1 width=8) (actual time=0.013..0.013 rows=0 loops=100)

  • Index Cond: ((opportunity_id)::text = (sf_opps.id)::text)
  • Filter: ((stage_name)::text = 'Überarbeitung versendet'::text)
  • Rows Removed by Filter: 4
88. 0.100 1.500 ↑ 1.0 1 100

Aggregate (cost=28.33..28.34 rows=1 width=8) (actual time=0.015..0.015 rows=1 loops=100)

89. 1.400 1.400 ↓ 0.0 0 100

Index Scan using opp_id_idx on opportunity_history opp_stages_11 (cost=0.42..28.32 rows=1 width=8) (actual time=0.013..0.014 rows=0 loops=100)

  • Index Cond: ((opportunity_id)::text = (sf_opps.id)::text)
  • Filter: ((stage_name)::text = 'Überarbeitung versendet'::text)
  • Rows Removed by Filter: 4
90. 0.100 1.400 ↑ 1.0 1 100

Aggregate (cost=28.33..28.34 rows=1 width=8) (actual time=0.014..0.014 rows=1 loops=100)

91. 1.300 1.300 ↓ 0.0 0 100

Index Scan using opp_id_idx on opportunity_history opp_stages_12 (cost=0.42..28.32 rows=1 width=8) (actual time=0.013..0.013 rows=0 loops=100)

  • Index Cond: ((opportunity_id)::text = (sf_opps.id)::text)
  • Filter: ((stage_name)::text = 'Buchung abschließen'::text)
  • Rows Removed by Filter: 4
92. 0.100 1.400 ↑ 1.0 1 100

Aggregate (cost=28.33..28.34 rows=1 width=8) (actual time=0.014..0.014 rows=1 loops=100)

93. 1.300 1.300 ↓ 0.0 0 100

Index Scan using opp_id_idx on opportunity_history opp_stages_13 (cost=0.42..28.32 rows=1 width=8) (actual time=0.013..0.013 rows=0 loops=100)

  • Index Cond: ((opportunity_id)::text = (sf_opps.id)::text)
  • Filter: ((stage_name)::text = 'Closed Won'::text)
  • Rows Removed by Filter: 4
94. 0.200 1.600 ↑ 1.0 1 100

Aggregate (cost=28.33..28.34 rows=1 width=8) (actual time=0.015..0.016 rows=1 loops=100)

95. 1.400 1.400 ↑ 1.5 2 100

Index Scan using opp_id_idx on opportunity_history opp_stages_14 (cost=0.42..28.32 rows=3 width=8) (actual time=0.013..0.014 rows=2 loops=100)

  • Index Cond: ((opportunity_id)::text = (sf_opps.id)::text)
  • Filter: ((stage_name)::text = 'Closed Lost'::text)
  • Rows Removed by Filter: 2
96. 0.200 3.600 ↑ 1.0 1 100

Unique (cost=28.63..28.64 rows=1 width=8) (actual time=0.035..0.036 rows=1 loops=100)

97. 0.400 3.400 ↑ 1.0 1 100

Sort (cost=28.63..28.64 rows=1 width=8) (actual time=0.034..0.034 rows=1 loops=100)

  • Sort Key: (count(*) FILTER (WHERE (((opportunity_history.stage_name)::text = 'Überarbeitung versendet'::text) AND (((lag(opportunity_history.stage_name) OVER (?)))::text = 'Angebot überarbeiten'::text))))
  • Sort Method: quicksort Memory: 25kB
98. 0.300 3.000 ↑ 1.0 1 100

Aggregate (cost=28.61..28.62 rows=1 width=8) (actual time=0.030..0.030 rows=1 loops=100)

99. 0.600 2.700 ↑ 1.5 4 100

WindowAgg (cost=28.39..28.51 rows=6 width=505) (actual time=0.022..0.027 rows=4 loops=100)

100. 0.600 2.100 ↑ 1.5 4 100

Sort (cost=28.39..28.40 rows=6 width=38) (actual time=0.020..0.021 rows=4 loops=100)

  • Sort Key: opportunity_history.created_date
  • Sort Method: quicksort Memory: 25kB
101. 1.500 1.500 ↑ 1.5 4 100

Index Scan using opp_id_idx on opportunity_history (cost=0.42..28.31 rows=6 width=38) (actual time=0.013..0.015 rows=4 loops=100)

  • Index Cond: ((opportunity_id)::text = (sf_opps.id)::text)
Planning time : 57.687 ms
Execution time : 3,980.650 ms