explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Oh74

Settings
# exclusive inclusive rows x rows loops node
1. 0.129 367,093.087 ↑ 1.0 100 1

Limit (cost=43,312.34..20,827,113.63 rows=100 width=297) (actual time=13,310.099..367,093.087 rows=100 loops=1)

2. 2.725 367,092.958 ↑ 2,249,414.2 100 1

Nested Loop (cost=43,312.34..46,751,377,164,123.44 rows=224,941,417 width=297) (actual time=13,310.098..367,092.958 rows=100 loops=1)

3. 0.320 231,859.119 ↑ 7,232.6 100 1

Nested Loop Left Join (cost=43,311.92..36,743,220,876.59 rows=723,264 width=128) (actual time=6,974.506..231,859.119 rows=100 loops=1)

  • Join Filter: (ppt.id = ppp.type_id)
  • Rows Removed by Join Filter: 1790
4. 3.337 231,858.499 ↑ 7,232.6 100 1

Hash Left Join (cost=43,311.92..36,743,056,301.36 rows=723,264 width=128) (actual time=6,974.493..231,858.499 rows=100 loops=1)

  • Hash Cond: ((SubPlan 4) = ppp.id)
5. 0.336 12,474.741 ↑ 7,232.6 100 1

Nested Loop Left Join (cost=0.00..34,239,460,115.08 rows=723,264 width=120) (actual time=319.879..12,474.741 rows=100 loops=1)

  • Join Filter: (cpt.id = ro.period_type_id)
  • Rows Removed by Join Filter: 804
6. 7,168.034 12,474.305 ↑ 7,232.6 100 1

Nested Loop (cost=0.00..34,239,287,296.06 rows=723,264 width=50) (actual time=319.859..12,474.305 rows=100 loops=1)

  • Join Filter: (ro.club_card_scan_code = c.scan_code)
  • Rows Removed by Join Filter: 126274699
7. 6.268 13.671 ↑ 7,232.6 100 1

Nested Loop (cost=0.00..23,662,612.81 rows=723,264 width=50) (actual time=3.136..13.671 rows=100 loops=1)

  • Join Filter: (ro.pivot_partner_id = pp.pharm_id)
  • Rows Removed by Join Filter: 118569
8. 0.044 0.303 ↑ 7,299.6 100 1

Append (cost=0.00..33,226.01 rows=729,964 width=46) (actual time=0.015..0.303 rows=100 loops=1)

9. 0.259 0.259 ↑ 7,299.6 100 1

Seq Scan on t_roznica_outcome_service_default ro (cost=0.00..29,576.19 rows=729,964 width=46) (actual time=0.014..0.259 rows=100 loops=1)

  • Filter: (service_id = 3)
  • Rows Removed by Filter: 1
10. 4.461 7.100 ↑ 1.8 1,187 100

Materialize (cost=0.00..346.99 rows=2,159 width=4) (actual time=0.001..0.071 rows=1,187 loops=100)

11. 2.639 2.639 ↑ 1.3 1,721 1

Seq Scan on t_partner_pharm pp (cost=0.00..336.19 rows=2,159 width=4) (actual time=0.007..2.639 rows=1,721 loops=1)

  • Filter: (NOT is_test)
  • Rows Removed by Filter: 18
12. 4,927.528 5,292.600 ↑ 2.5 1,262,748 100

Materialize (cost=0.00..84,879.13 rows=3,153,809 width=16) (actual time=0.001..52.926 rows=1,262,748 loops=100)

13. 365.072 365.072 ↓ 1.0 3,161,166 1

Seq Scan on t_card c (cost=0.00..69,110.09 rows=3,153,809 width=16) (actual time=0.008..365.072 rows=3,161,166 loops=1)

14. 0.089 0.100 ↑ 1.8 9 100

Materialize (cost=0.00..1.44 rows=16 width=78) (actual time=0.000..0.001 rows=9 loops=100)

15. 0.011 0.011 ↑ 1.3 12 1

Seq Scan on t_card_period_type cpt (cost=0.00..1.36 rows=16 width=78) (actual time=0.009..0.011 rows=12 loops=1)

16. 180.854 334.752 ↓ 1.0 1,293,732 1

Hash (cost=27,769.74..27,769.74 rows=1,243,374 width=8) (actual time=334.752..334.752 rows=1,293,732 loops=1)

  • Buckets: 2097152 Batches: 1 Memory Usage: 66921kB
17. 153.898 153.898 ↓ 1.0 1,293,732 1

Seq Scan on t_card_period ppp (cost=0.00..27,769.74 rows=1,243,374 width=8) (actual time=0.009..153.898 rows=1,293,732 loops=1)

18.          

SubPlan (for Hash Left Join)

19. 0.404 219,045.669 ↓ 0.0 0 101

Limit (cost=69,228.38..69,228.38 rows=1 width=12) (actual time=2,168.769..2,168.769 rows=0 loops=101)

20. 0.909 219,045.265 ↓ 0.0 0 101

Sort (cost=69,228.38..69,228.38 rows=1 width=12) (actual time=2,168.765..2,168.765 rows=0 loops=101)

  • Sort Key: h_12.outcome_date_sale DESC
  • Sort Method: quicksort Memory: 25kB
21. 0.308 219,044.356 ↓ 0.0 0 101

Nested Loop (cost=12.13..69,228.37 rows=1 width=12) (actual time=2,114.811..2,168.756 rows=0 loops=101)

  • Join Filter: (p.type_id = t.id)
  • Rows Removed by Join Filter: 6
22. 2.289 219,043.649 ↑ 1.0 1 101

Nested Loop (cost=12.13..69,226.79 rows=1 width=16) (actual time=1,792.386..2,168.749 rows=1 loops=101)

23. 21,903.073 219,040.013 ↓ 4.0 4 101

Nested Loop (cost=11.41..69,224.85 rows=1 width=12) (actual time=1,301.203..2,168.713 rows=4 loops=101)

  • Join Filter: (ca_3.id = h_12.loyal_card_id)
  • Rows Removed by Join Filter: 5343165
24. 0.707 2.020 ↑ 1.0 1 101

Bitmap Heap Scan on t_card ca_3 (cost=1.64..2.85 rows=1 width=4) (actual time=0.018..0.020 rows=1 loops=101)

  • Recheck Cond: (client_id = c.client_id)
  • Heap Blocks: exact=118
25. 1.313 1.313 ↑ 1.0 1 101

Bitmap Index Scan on t_card_idx2 (cost=0.00..1.64 rows=1 width=0) (actual time=0.013..0.013 rows=1 loops=101)

  • Index Cond: (client_id = c.client_id)
26. 23,295.600 197,134.920 ↓ 216.9 4,497,167 120

Append (cost=9.77..68,962.81 rows=20,735 width=16) (actual time=5.231..1,642.791 rows=4,497,167 loops=120)

27. 3,343.200 3,941.640 ↓ 599.7 113,949 120

Bitmap Heap Scan on t_roznica_outcome_head_2018 h_12 (cost=9.77..630.02 rows=190 width=16) (actual time=5.223..32.847 rows=113,949 loops=120)

  • Recheck Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
  • Filter: (outcome_date_sale < ro.outcome_date_sale)
  • Heap Blocks: exact=263880
28. 598.440 598.440 ↓ 199.9 113,949 120

Bitmap Index Scan on t_roznica_outcome_head_2018_date_pivot_partner_id_employ_id_idx (cost=0.00..9.72 rows=570 width=0) (actual time=4.987..4.987 rows=113,949 loops=120)

  • Index Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
29. 145,286.520 169,841.640 ↓ 213.3 4,381,671 120

Bitmap Heap Scan on t_roznica_outcome_head_2019 h_13 (cost=925.40..68,215.18 rows=20,541 width=16) (actual time=221.687..1,415.347 rows=4,381,671 loops=120)

  • Recheck Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
  • Filter: (outcome_date_sale < ro.outcome_date_sale)
  • Rows Removed by Filter: 32576
  • Heap Blocks: exact=12349995
30. 24,555.120 24,555.120 ↓ 71.6 4,414,248 120

Bitmap Index Scan on t_roznica_outcome_head_2019_date_pivot_partner_id_employ_id_idx (cost=0.00..920.27 rows=61,623 width=0) (actual time=204.626..204.626 rows=4,414,248 loops=120)

  • Index Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
31. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on t_roznica_outcome_head_2020 h_14 (cost=1.36..2.58 rows=1 width=16) (never executed)

  • Recheck Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
  • Filter: (outcome_date_sale < ro.outcome_date_sale)
32. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on t_roznica_outcome_head_2020_date_pivot_partner_id_employ_id_idx (cost=0.00..1.36 rows=1 width=0) (never executed)

  • Index Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
33. 47.040 56.040 ↓ 515.7 1,547 120

Bitmap Heap Scan on t_roznica_outcome_head_default h_15 (cost=1.56..11.36 rows=3 width=16) (actual time=0.086..0.467 rows=1,547 loops=120)

  • Recheck Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
  • Filter: (outcome_date_sale < ro.outcome_date_sale)
  • Heap Blocks: exact=4200
34. 9.000 9.000 ↓ 193.4 1,547 120

Bitmap Index Scan on t_roznica_outcome_head_defaul_date_pivot_partner_id_employ__idx (cost=0.00..1.56 rows=8 width=0) (actual time=0.075..0.075 rows=1,547 loops=120)

  • Index Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
35. 0.449 1.347 ↓ 0.0 0 449

Bitmap Heap Scan on t_card_period p (cost=0.73..1.94 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=449)

  • Recheck Cond: (id = h_12.loyal_period_id)
  • Heap Blocks: exact=57
36. 0.898 0.898 ↓ 0.0 0 449

Bitmap Index Scan on t_card_period_pkey (cost=0.00..0.73 rows=1 width=0) (actual time=0.002..0.002 rows=0 loops=449)

  • Index Cond: (id = h_12.loyal_period_id)
37. 0.399 0.399 ↑ 1.2 12 57

Seq Scan on t_card_period_type t (cost=0.00..1.40 rows=14 width=4) (actual time=0.005..0.007 rows=12 loops=57)

  • Filter: (price > '0'::numeric)
  • Rows Removed by Filter: 2
38. 0.289 0.300 ↓ 1.1 18 100

Materialize (cost=0.00..1.44 rows=16 width=8) (actual time=0.001..0.003 rows=18 loops=100)

39. 0.011 0.011 ↓ 1.1 18 1

Seq Scan on t_card_period_type ppt (cost=0.00..1.36 rows=16 width=8) (actual time=0.006..0.011 rows=18 loops=1)

40. 1.414 5.300 ↑ 4.0 1 100

Append (cost=0.43..6.28 rows=4 width=12) (actual time=0.030..0.053 rows=1 loops=100)

41. 0.100 1.400 ↓ 0.0 0 100

Bitmap Heap Scan on t_roznica_outcome_head_2018 roh (cost=0.43..1.64 rows=1 width=12) (actual time=0.014..0.014 rows=0 loops=100)

  • Recheck Cond: ((roznica_outcome_head_id = ro.roznica_outcome_head_id) AND (pivot_partner_id = ro.pivot_partner_id))
42. 1.300 1.300 ↓ 0.0 0 100

Bitmap Index Scan on t_roznica_outcome_head_2018_roznica_outcome_head_id_pivot_p_idx (cost=0.00..0.43 rows=1 width=0) (actual time=0.013..0.013 rows=0 loops=100)

  • Index Cond: ((roznica_outcome_head_id = ro.roznica_outcome_head_id) AND (pivot_partner_id = ro.pivot_partner_id))
43. 0.400 1.100 ↑ 1.0 1 100

Bitmap Heap Scan on t_roznica_outcome_head_2019 roh_1 (cost=0.53..1.75 rows=1 width=12) (actual time=0.010..0.011 rows=1 loops=100)

  • Recheck Cond: ((roznica_outcome_head_id = ro.roznica_outcome_head_id) AND (pivot_partner_id = ro.pivot_partner_id))
  • Heap Blocks: exact=100
44. 0.700 0.700 ↑ 1.0 1 100

Bitmap Index Scan on t_roznica_outcome_head_2019_roznica_outcome_head_id_pivot_p_idx (cost=0.00..0.53 rows=1 width=0) (actual time=0.007..0.007 rows=1 loops=100)

  • Index Cond: ((roznica_outcome_head_id = ro.roznica_outcome_head_id) AND (pivot_partner_id = ro.pivot_partner_id))
45. 0.297 0.693 ↓ 0.0 0 99

Bitmap Heap Scan on t_roznica_outcome_head_2020 roh_2 (cost=0.16..1.37 rows=1 width=12) (actual time=0.007..0.007 rows=0 loops=99)

  • Recheck Cond: ((roznica_outcome_head_id = ro.roznica_outcome_head_id) AND (pivot_partner_id = ro.pivot_partner_id))
46. 0.396 0.396 ↓ 0.0 0 99

Bitmap Index Scan on t_roznica_outcome_head_2020_roznica_outcome_head_id_pivot_p_idx (cost=0.00..0.16 rows=1 width=0) (actual time=0.004..0.004 rows=0 loops=99)

  • Index Cond: ((roznica_outcome_head_id = ro.roznica_outcome_head_id) AND (pivot_partner_id = ro.pivot_partner_id))
47. 0.099 0.693 ↓ 0.0 0 99

Bitmap Heap Scan on t_roznica_outcome_head_default roh_3 (cost=0.29..1.50 rows=1 width=12) (actual time=0.007..0.007 rows=0 loops=99)

  • Recheck Cond: ((roznica_outcome_head_id = ro.roznica_outcome_head_id) AND (pivot_partner_id = ro.pivot_partner_id))
48. 0.594 0.594 ↓ 0.0 0 99

Bitmap Index Scan on t_roznica_outcome_head_defaul_roznica_outcome_head_id_pivot_idx (cost=0.00..0.29 rows=1 width=0) (actual time=0.006..0.006 rows=0 loops=99)

  • Index Cond: ((roznica_outcome_head_id = ro.roznica_outcome_head_id) AND (pivot_partner_id = ro.pivot_partner_id))
49.          

SubPlan (for Nested Loop)

50. 12,299.413 128,890.278 ↑ 1.0 1 99

Nested Loop (cost=11.41..69,224.85 rows=1 width=0) (actual time=1,301.922..1,301.922 rows=1 loops=99)

  • Join Filter: (ca.id = h.loyal_card_id)
  • Rows Removed by Join Filter: 3065235
51. 0.297 0.990 ↑ 1.0 1 99

Bitmap Heap Scan on t_card ca (cost=1.64..2.85 rows=1 width=4) (actual time=0.009..0.010 rows=1 loops=99)

  • Recheck Cond: (client_id = c.client_id)
  • Heap Blocks: exact=107
52. 0.693 0.693 ↑ 1.0 1 99

Bitmap Index Scan on t_card_idx2 (cost=0.00..1.64 rows=1 width=0) (actual time=0.007..0.007 rows=1 loops=99)

  • Index Cond: (client_id = c.client_id)
53. 13,284.158 116,589.875 ↓ 136.8 2,836,059 107

Append (cost=9.77..68,962.81 rows=20,735 width=4) (actual time=5.255..1,089.625 rows=2,836,059 loops=107)

54. 2,878.728 3,414.905 ↓ 599.7 113,949 107

Bitmap Heap Scan on t_roznica_outcome_head_2018 h (cost=9.77..630.02 rows=190 width=4) (actual time=5.248..31.915 rows=113,949 loops=107)

  • Recheck Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
  • Filter: (outcome_date_sale < ro.outcome_date_sale)
  • Heap Blocks: exact=235293
55. 536.177 536.177 ↓ 199.9 113,949 107

Bitmap Index Scan on t_roznica_outcome_head_2018_date_pivot_partner_id_employ_id_idx (cost=0.00..9.72 rows=570 width=0) (actual time=5.011..5.011 rows=113,949 loops=107)

  • Index Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
56. 78,435.708 99,870.697 ↓ 132.5 2,721,460 107

Bitmap Heap Scan on t_roznica_outcome_head_2019 h_1 (cost=925.40..68,215.18 rows=20,541 width=4) (actual time=217.363..933.371 rows=2,721,460 loops=107)

  • Recheck Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
  • Filter: (outcome_date_sale < ro.outcome_date_sale)
  • Rows Removed by Filter: 16660
  • Heap Blocks: exact=6541735
57. 21,434.989 21,434.989 ↓ 70.9 4,366,340 107

Bitmap Index Scan on t_roznica_outcome_head_2019_date_pivot_partner_id_employ_id_idx (cost=0.00..920.27 rows=61,623 width=0) (actual time=200.327..200.327 rows=4,366,340 loops=107)

  • Index Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
58. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on t_roznica_outcome_head_2020 h_2 (cost=1.36..2.58 rows=1 width=4) (never executed)

  • Recheck Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
  • Filter: (outcome_date_sale < ro.outcome_date_sale)
59. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on t_roznica_outcome_head_2020_date_pivot_partner_id_employ_id_idx (cost=0.00..1.36 rows=1 width=0) (never executed)

  • Index Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
60. 16.785 20.115 ↓ 515.7 1,547 45

Bitmap Heap Scan on t_roznica_outcome_head_default h_3 (cost=1.56..11.36 rows=3 width=4) (actual time=0.087..0.447 rows=1,547 loops=45)

  • Recheck Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
  • Filter: (outcome_date_sale < ro.outcome_date_sale)
  • Heap Blocks: exact=1575
61. 3.330 3.330 ↓ 193.4 1,547 45

Bitmap Index Scan on t_roznica_outcome_head_defaul_date_pivot_partner_id_employ__idx (cost=0.00..1.56 rows=8 width=0) (actual time=0.074..0.074 rows=1,547 loops=45)

  • Index Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
62. 0.005 3,176.612 ↑ 1.0 1 1

Limit (cost=69,224.86..69,224.87 rows=1 width=12) (actual time=3,176.608..3,176.612 rows=1 loops=1)

63. 0.034 3,176.607 ↑ 1.0 1 1

Sort (cost=69,224.86..69,224.87 rows=1 width=12) (actual time=3,176.607..3,176.607 rows=1 loops=1)

  • Sort Key: h_4.outcome_date_sale DESC
  • Sort Method: top-N heapsort Memory: 25kB
64. 336.034 3,176.573 ↓ 15.0 15 1

Nested Loop (cost=11.41..69,224.85 rows=1 width=12) (actual time=423.996..3,176.573 rows=15 loops=1)

  • Join Filter: (ca_1.id = h_4.loyal_card_id)
  • Rows Removed by Join Filter: 8106649
65. 0.003 0.009 ↑ 1.0 1 1

Bitmap Heap Scan on t_card ca_1 (cost=1.64..2.85 rows=1 width=4) (actual time=0.008..0.009 rows=1 loops=1)

  • Recheck Cond: (client_id = c.client_id)
  • Heap Blocks: exact=1
66. 0.006 0.006 ↑ 1.0 1 1

Bitmap Index Scan on t_card_idx2 (cost=0.00..1.64 rows=1 width=0) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (client_id = c.client_id)
67. 373.265 2,840.530 ↓ 391.0 8,106,664 1

Append (cost=9.77..68,962.81 rows=20,735 width=16) (actual time=5.171..2,840.530 rows=8,106,664 loops=1)

68. 26.505 31.416 ↓ 599.7 113,949 1

Bitmap Heap Scan on t_roznica_outcome_head_2018 h_4 (cost=9.77..630.02 rows=190 width=16) (actual time=5.164..31.416 rows=113,949 loops=1)

  • Recheck Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
  • Filter: (outcome_date_sale < ro.outcome_date_sale)
  • Heap Blocks: exact=2199
69. 4.911 4.911 ↓ 199.9 113,949 1

Bitmap Index Scan on t_roznica_outcome_head_2018_date_pivot_partner_id_employ_id_idx (cost=0.00..9.72 rows=570 width=0) (actual time=4.911..4.911 rows=113,949 loops=1)

  • Index Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
70. 2,081.240 2,435.394 ↓ 389.0 7,991,168 1

Bitmap Heap Scan on t_roznica_outcome_head_2019 h_5 (cost=925.40..68,215.18 rows=20,541 width=16) (actual time=382.445..2,435.394 rows=7,991,168 loops=1)

  • Recheck Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
  • Filter: (outcome_date_sale < ro.outcome_date_sale)
  • Rows Removed by Filter: 32900
  • Heap Blocks: exact=167223
71. 354.154 354.154 ↓ 130.2 8,024,068 1

Bitmap Index Scan on t_roznica_outcome_head_2019_date_pivot_partner_id_employ_id_idx (cost=0.00..920.27 rows=61,623 width=0) (actual time=354.154..354.154 rows=8,024,068 loops=1)

  • Index Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
72. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on t_roznica_outcome_head_2020 h_6 (cost=1.36..2.58 rows=1 width=16) (never executed)

  • Recheck Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
  • Filter: (outcome_date_sale < ro.outcome_date_sale)
73. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on t_roznica_outcome_head_2020_date_pivot_partner_id_employ_id_idx (cost=0.00..1.36 rows=1 width=0) (never executed)

  • Index Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
74. 0.377 0.455 ↓ 515.7 1,547 1

Bitmap Heap Scan on t_roznica_outcome_head_default h_7 (cost=1.56..11.36 rows=3 width=16) (actual time=0.092..0.455 rows=1,547 loops=1)

  • Recheck Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
  • Filter: (outcome_date_sale < ro.outcome_date_sale)
  • Heap Blocks: exact=35
75. 0.078 0.078 ↓ 193.4 1,547 1

Bitmap Index Scan on t_roznica_outcome_head_defaul_date_pivot_partner_id_employ__idx (cost=0.00..1.56 rows=8 width=0) (actual time=0.078..0.078 rows=1,547 loops=1)

  • Index Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
76. 0.004 3,158.924 ↑ 1.0 1 1

Limit (cost=69,224.86..69,224.87 rows=1 width=12) (actual time=3,158.921..3,158.924 rows=1 loops=1)

77. 0.038 3,158.920 ↑ 1.0 1 1

Sort (cost=69,224.86..69,224.87 rows=1 width=12) (actual time=3,158.920..3,158.920 rows=1 loops=1)

  • Sort Key: h_8.outcome_date_sale DESC
  • Sort Method: top-N heapsort Memory: 25kB
78. 332.471 3,158.882 ↓ 15.0 15 1

Nested Loop (cost=11.41..69,224.85 rows=1 width=12) (actual time=424.717..3,158.882 rows=15 loops=1)

  • Join Filter: (ca_2.id = h_8.loyal_card_id)
  • Rows Removed by Join Filter: 8106649
79. 0.003 0.010 ↑ 1.0 1 1

Bitmap Heap Scan on t_card ca_2 (cost=1.64..2.85 rows=1 width=4) (actual time=0.009..0.010 rows=1 loops=1)

  • Recheck Cond: (client_id = c.client_id)
  • Heap Blocks: exact=1
80. 0.007 0.007 ↑ 1.0 1 1

Bitmap Index Scan on t_card_idx2 (cost=0.00..1.64 rows=1 width=0) (actual time=0.007..0.007 rows=1 loops=1)

  • Index Cond: (client_id = c.client_id)
81. 356.554 2,826.401 ↓ 391.0 8,106,664 1

Append (cost=9.77..68,962.81 rows=20,735 width=16) (actual time=5.135..2,826.401 rows=8,106,664 loops=1)

82. 26.491 31.387 ↓ 599.7 113,949 1

Bitmap Heap Scan on t_roznica_outcome_head_2018 h_8 (cost=9.77..630.02 rows=190 width=16) (actual time=5.127..31.387 rows=113,949 loops=1)

  • Recheck Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
  • Filter: (outcome_date_sale < ro.outcome_date_sale)
  • Heap Blocks: exact=2199
83. 4.896 4.896 ↓ 199.9 113,949 1

Bitmap Index Scan on t_roznica_outcome_head_2018_date_pivot_partner_id_employ_id_idx (cost=0.00..9.72 rows=570 width=0) (actual time=4.896..4.896 rows=113,949 loops=1)

  • Index Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
84. 2,083.004 2,438.011 ↓ 389.0 7,991,168 1

Bitmap Heap Scan on t_roznica_outcome_head_2019 h_9 (cost=925.40..68,215.18 rows=20,541 width=16) (actual time=383.092..2,438.011 rows=7,991,168 loops=1)

  • Recheck Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
  • Filter: (outcome_date_sale < ro.outcome_date_sale)
  • Rows Removed by Filter: 32900
  • Heap Blocks: exact=167223
85. 355.007 355.007 ↓ 130.2 8,024,068 1

Bitmap Index Scan on t_roznica_outcome_head_2019_date_pivot_partner_id_employ_id_idx (cost=0.00..920.27 rows=61,623 width=0) (actual time=355.007..355.007 rows=8,024,068 loops=1)

  • Index Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
86. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on t_roznica_outcome_head_2020 h_10 (cost=1.36..2.58 rows=1 width=16) (never executed)

  • Recheck Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
  • Filter: (outcome_date_sale < ro.outcome_date_sale)
87. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on t_roznica_outcome_head_2020_date_pivot_partner_id_employ_id_idx (cost=0.00..1.36 rows=1 width=0) (never executed)

  • Index Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
88. 0.374 0.449 ↓ 515.7 1,547 1

Bitmap Heap Scan on t_roznica_outcome_head_default h_11 (cost=1.56..11.36 rows=3 width=16) (actual time=0.089..0.449 rows=1,547 loops=1)

  • Recheck Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
  • Filter: (outcome_date_sale < ro.outcome_date_sale)
  • Heap Blocks: exact=35
89. 0.075 0.075 ↓ 193.4 1,547 1

Bitmap Index Scan on t_roznica_outcome_head_defaul_date_pivot_partner_id_employ__idx (cost=0.00..1.56 rows=8 width=0) (actual time=0.075..0.075 rows=1,547 loops=1)

  • Index Cond: (((outcome_date_sale)::date >= '2018-10-01'::date) AND ((outcome_date_sale)::date <= (ro.outcome_date_sale)::date))
Planning time : 7.205 ms
Execution time : 367,132.919 ms