explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GlpK

Settings
# exclusive inclusive rows x rows loops node
1. 0.334 3,468.853 ↑ 1.0 1 1

Aggregate (cost=20,617.39..20,617.40 rows=1 width=8) (actual time=3,468.853..3,468.853 rows=1 loops=1)

2.          

CTE mediaplan_cte

3. 0.000 509.036 ↑ 1.0 1 1

Aggregate (cost=8,989.45..8,989.46 rows=1 width=32) (actual time=509.036..509.036 rows=1 loops=1)

4.          

Initplan (forAggregate)

5. 0.252 5.645 ↑ 1.0 1 1

Aggregate (cost=2,367.65..2,367.66 rows=1 width=32) (actual time=5.645..5.645 rows=1 loops=1)

6. 0.686 5.393 ↓ 374.0 1,496 1

Hash Left Join (cost=1,699.22..2,367.64 rows=4 width=8) (actual time=2.891..5.393 rows=1,496 loops=1)

  • Hash Cond: (account_5.parent_id = account_6.id)
  • Filter: ((account.id = 2000001) OR (account_4.id = 2000001) OR (account_5.id = 2000001) OR (account_6.id = 2000001))
  • Rows Removed by Filter: 15
7. 0.422 3.788 ↓ 1.0 1,511 1

Hash Left Join (cost=1,225.39..1,859.06 rows=1,465 width=32) (actual time=1.949..3.788 rows=1,511 loops=1)

  • Hash Cond: (account_4.parent_id = account_5.id)
8. 0.492 2.554 ↓ 1.0 1,511 1

Hash Left Join (cost=612.69..1,226.24 rows=1,465 width=24) (actual time=1.122..2.554 rows=1,511 loops=1)

  • Hash Cond: (account.parent_id = account_4.id)
9. 0.963 0.963 ↓ 1.0 1,511 1

Seq Scan on account (cost=0.00..593.42 rows=1,465 width=16) (actual time=0.004..0.963 rows=1,511 loops=1)

  • Filter: (deleted IS FALSE)
  • Rows Removed by Filter: 78
10. 0.297 1.099 ↓ 1.0 1,589 1

Hash (cost=593.42..593.42 rows=1,542 width=16) (actual time=1.099..1.099 rows=1,589 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 91kB
11. 0.802 0.802 ↓ 1.0 1,589 1

Seq Scan on account account_4 (cost=0.00..593.42 rows=1,542 width=16) (actual time=0.002..0.802 rows=1,589 loops=1)

12. 0.290 0.812 ↓ 1.0 1,589 1

Hash (cost=593.42..593.42 rows=1,542 width=16) (actual time=0.812..0.812 rows=1,589 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 91kB
13. 0.522 0.522 ↓ 1.0 1,589 1

Seq Scan on account account_5 (cost=0.00..593.42 rows=1,542 width=16) (actual time=0.004..0.522 rows=1,589 loops=1)

14. 0.278 0.919 ↓ 1.0 1,589 1

Hash (cost=454.55..454.55 rows=1,542 width=8) (actual time=0.919..0.919 rows=1,589 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 79kB
15. 0.641 0.641 ↓ 1.0 1,589 1

Index Only Scan using account_pkey on account account_6 (cost=0.28..454.55 rows=1,542 width=8) (actual time=0.007..0.641 rows=1,589 loops=1)

  • Heap Fetches: 881
16. 0.120 508.667 ↓ 265.5 531 1

Nested Loop (cost=1,116.39..6,621.78 rows=2 width=8) (actual time=194.441..508.667 rows=531 loops=1)

17. 0.036 0.036 ↑ 1.0 1 1

Seq Scan on vimb_site_owner vimb_site_owner_2 (cost=0.00..3.21 rows=1 width=8) (actual time=0.026..0.036 rows=1 loops=1)

  • Filter: ((deleted IS FALSE) AND (id = 91))
  • Rows Removed by Filter: 107
18. 17.750 508.511 ↓ 265.5 531 1

Nested Loop (cost=1,116.39..6,618.55 rows=2 width=16) (actual time=194.411..508.511 rows=531 loops=1)

  • Join Filter: (vimb_section_2.site_id = vimb_site_2.id)
  • Rows Removed by Join Filter: 63365
19. 12.501 490.761 ↓ 86.8 15,974 1

Nested Loop (cost=1,116.39..6,586.08 rows=184 width=16) (actual time=186.331..490.761 rows=15,974 loops=1)

20. 0.753 446.312 ↓ 80.3 15,974 1

Nested Loop (cost=1,116.11..6,517.52 rows=199 width=16) (actual time=186.322..446.312 rows=15,974 loops=1)

21. 4.820 397.637 ↓ 73.6 15,974 1

Nested Loop (cost=1,115.84..6,451.27 rows=217 width=16) (actual time=186.311..397.637 rows=15,974 loops=1)

22. 0.887 365.793 ↓ 14.3 2,252 1

Nested Loop (cost=1,115.41..5,435.89 rows=158 width=8) (actual time=186.298..365.793 rows=2,252 loops=1)

23. 9.181 358.150 ↓ 13.6 2,252 1

Nested Loop (cost=1,115.13..5,382.75 rows=166 width=16) (actual time=186.287..358.150 rows=2,252 loops=1)

  • Join Filter: (project_1.id = vimb_mediaplan_2.project_id)
24. 19.876 174.144 ↓ 129.4 24,975 1

Hash Join (cost=1,114.71..1,916.45 rows=193 width=16) (actual time=145.191..174.144 rows=24,975 loops=1)

  • Hash Cond: (vimb_order_1.project_id = project_1.id)
25. 9.110 9.110 ↑ 1.0 24,977 1

Seq Scan on vimb_order vimb_order_1 (cost=0.00..704.36 rows=25,483 width=8) (actual time=0.004..9.110 rows=24,977 loops=1)

  • Filter: (deleted IS FALSE)
  • Rows Removed by Filter: 347
26. 10.547 145.158 ↓ 135.0 24,976 1

Hash (cost=1,112.40..1,112.40 rows=185 width=8) (actual time=145.158..145.158 rows=24,976 loops=1)

  • Buckets: 32768 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1232kB
27. 25.000 134.611 ↓ 135.0 24,976 1

Nested Loop (cost=46.45..1,112.40 rows=185 width=8) (actual time=12.244..134.611 rows=24,976 loops=1)

28. 22.623 34.683 ↓ 128.1 24,976 1

Bitmap Heap Scan on project project_1 (cost=46.17..608.44 rows=195 width=16) (actual time=12.229..34.683 rows=24,976 loops=1)

  • Recheck Cond: (account_id = ANY ($0))
  • Filter: (deleted IS FALSE)
  • Heap Blocks: exact=1113
29. 12.060 12.060 ↓ 128.1 24,980 1

Bitmap Index Scan on project_account_id_deleted_fkey_idx (cost=0.00..46.12 rows=195 width=0) (actual time=12.060..12.060 rows=24,980 loops=1)

  • Index Cond: ((account_id = ANY ($0)) AND (deleted = false))
30. 74.928 74.928 ↑ 1.0 1 24,976

Index Only Scan using account_id_deleted_pkey_idx on account vimb_advertiser_1 (cost=0.28..2.57 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=24,976)

  • Index Cond: ((id = project_1.account_id) AND (deleted = false))
  • Filter: (deleted IS FALSE)
  • Heap Fetches: 15389
31. 174.825 174.825 ↓ 0.0 0 24,975

Index Scan using vimb_mediaplan_project_id_fkey_idx on vimb_mediaplan vimb_mediaplan_2 (cost=0.42..17.95 rows=1 width=24) (actual time=0.007..0.007 rows=0 loops=24,975)

  • Index Cond: (project_id = vimb_order_1.project_id)
  • Filter: ((deleted IS FALSE) AND (end_date >= '2018-12-01'::date) AND (start_date <= '2018-12-18'::date))
  • Rows Removed by Filter: 3
32. 6.756 6.756 ↑ 1.0 1 2,252

Index Scan using vimb_product_pkey on vimb_product vimb_product_1 (cost=0.28..0.31 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=2,252)

  • Index Cond: (id = vimb_mediaplan_2.product_id)
  • Filter: (deleted IS FALSE)
33. 27.024 27.024 ↑ 2.9 7 2,252

Index Scan using vimb_fragment_mediaplan_id_fkey_idx on vimb_fragment vimb_fragment_2 (cost=0.42..6.23 rows=20 width=16) (actual time=0.004..0.012 rows=7 loops=2,252)

  • Index Cond: (mediaplan_id = vimb_mediaplan_2.id)
34. 47.922 47.922 ↑ 1.0 1 15,974

Index Scan using vimb_position_pkey on vimb_position vimb_position_2 (cost=0.28..0.30 rows=1 width=16) (actual time=0.002..0.003 rows=1 loops=15,974)

  • Index Cond: (id = vimb_fragment_2.position_id)
  • Filter: (deleted IS FALSE)
35. 31.948 31.948 ↑ 1.0 1 15,974

Index Scan using vimb_section_pkey on vimb_section vimb_section_2 (cost=0.27..0.33 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=15,974)

  • Index Cond: (id = vimb_position_2.section_id)
  • Filter: (deleted IS FALSE)
36. 0.000 0.000 ↑ 1.2 4 15,974

Materialize (cost=0.00..18.67 rows=5 width=16) (actual time=0.000..0.000 rows=4 loops=15,974)

37. 0.196 0.196 ↑ 1.2 4 1

Seq Scan on vimb_site vimb_site_2 (cost=0.00..18.65 rows=5 width=16) (actual time=0.089..0.196 rows=4 loops=1)

  • Filter: ((deleted IS FALSE) AND (owner_id = 91))
  • Rows Removed by Filter: 369
38. 224.624 3,468.519 ↓ 356.0 356 1

Merge Left Join (cost=3,132.05..11,627.92 rows=1 width=1,979) (actual time=1,459.838..3,468.519 rows=356 loops=1)

  • Merge Cond: (vimb_site.id = vimb_fee_rate_4.site_id)
  • Join Filter: ((vimb_fragment.start_date >= vimb_fee_rate_4.date) AND COALESCE((vimb_fragment.end_date <= ((lead(vimb_fee_rate_4.date) OVER (?) - 1))), (((lead(vimb_fee_rate_4.date) OVER (?) - 1)) IS NULL)))
39.          

Initplan (forMerge Left Join)

40. 0.370 8.295 ↑ 1.0 1 1

Aggregate (cost=2,367.65..2,367.66 rows=1 width=32) (actual time=8.294..8.295 rows=1 loops=1)

41. 1.034 7.925 ↓ 374.0 1,496 1

Hash Left Join (cost=1,699.22..2,367.64 rows=4 width=8) (actual time=4.048..7.925 rows=1,496 loops=1)

  • Hash Cond: (account_9.parent_id = account_10.id)
  • Filter: ((account_1.id = 2000001) OR (account_8.id = 2000001) OR (account_9.id = 2000001) OR (account_10.id = 2000001))
  • Rows Removed by Filter: 15
42. 0.618 5.652 ↓ 1.0 1,511 1

Hash Left Join (cost=1,225.39..1,859.06 rows=1,465 width=32) (actual time=2.769..5.652 rows=1,511 loops=1)

  • Hash Cond: (account_8.parent_id = account_9.id)
43. 0.744 3.815 ↓ 1.0 1,511 1

Hash Left Join (cost=612.69..1,226.24 rows=1,465 width=24) (actual time=1.511..3.815 rows=1,511 loops=1)

  • Hash Cond: (account_1.parent_id = account_8.id)
44. 1.593 1.593 ↓ 1.0 1,511 1

Seq Scan on account account_1 (cost=0.00..593.42 rows=1,465 width=16) (actual time=0.006..1.593 rows=1,511 loops=1)

  • Filter: (deleted IS FALSE)
  • Rows Removed by Filter: 78
45. 0.379 1.478 ↓ 1.0 1,589 1

Hash (cost=593.42..593.42 rows=1,542 width=16) (actual time=1.478..1.478 rows=1,589 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 91kB
46. 1.099 1.099 ↓ 1.0 1,589 1

Seq Scan on account account_8 (cost=0.00..593.42 rows=1,542 width=16) (actual time=0.004..1.099 rows=1,589 loops=1)

47. 0.390 1.219 ↓ 1.0 1,589 1

Hash (cost=593.42..593.42 rows=1,542 width=16) (actual time=1.219..1.219 rows=1,589 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 91kB
48. 0.829 0.829 ↓ 1.0 1,589 1

Seq Scan on account account_9 (cost=0.00..593.42 rows=1,542 width=16) (actual time=0.006..0.829 rows=1,589 loops=1)

49. 0.357 1.239 ↓ 1.0 1,589 1

Hash (cost=454.55..454.55 rows=1,542 width=8) (actual time=1.239..1.239 rows=1,589 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 79kB
50. 0.882 0.882 ↓ 1.0 1,589 1

Index Only Scan using account_pkey on account account_10 (cost=0.28..454.55 rows=1,542 width=8) (actual time=0.011..0.882 rows=1,589 loops=1)

  • Heap Fetches: 881
51. 0.843 3,235.002 ↓ 356.0 356 1

Merge Left Join (cost=743.86..9,193.62 rows=1 width=246) (actual time=1,458.199..3,235.002 rows=356 loops=1)

  • Merge Cond: (vimb_site.id = vimb_fee_rate_3.site_id)
  • Join Filter: ((vimb_fragment.start_date >= vimb_fee_rate_3.date) AND COALESCE((vimb_fragment.end_date <= ((lead(vimb_fee_rate_3.date) OVER (?) - 1))), (((lead(vimb_fee_rate_3.date) OVER (?) - 1)) IS NULL)) AND (vimb_fee_rate_3.account_id = account_7.id))
  • Rows Removed by Join Filter: 356
52. 0.488 3,233.178 ↓ 356.0 356 1

Nested Loop Left Join (cost=711.90..9,145.97 rows=1 width=244) (actual time=1,457.221..3,233.178 rows=356 loops=1)

53. 0.933 3,230.910 ↓ 356.0 356 1

Merge Left Join (cost=711.62..9,145.38 rows=1 width=244) (actual time=1,457.202..3,230.910 rows=356 loops=1)

  • Merge Cond: (vimb_site.id = vimb_fee_rate_2.site_id)
  • Join Filter: ((vimb_fragment.start_date >= vimb_fee_rate_2.date) AND COALESCE((vimb_fragment.end_date <= ((lead(vimb_fee_rate_2.date) OVER (?) - 1))), (((lead(vimb_fee_rate_2.date) OVER (?) - 1)) IS NULL)) AND (vimb_fee_rate_2.account_id = vimb_holding.id))
  • Rows Removed by Join Filter: 356
54. 0.340 3,228.870 ↓ 356.0 356 1

Nested Loop Left Join (cost=679.67..9,097.72 rows=1 width=242) (actual time=1,456.061..3,228.870 rows=356 loops=1)

55. 0.866 3,226.394 ↓ 356.0 356 1

Merge Left Join (cost=679.39..9,095.73 rows=1 width=234) (actual time=1,456.049..3,226.394 rows=356 loops=1)

  • Merge Cond: (vimb_site.id = vimb_fee_rate_1.site_id)
  • Join Filter: ((vimb_fragment.start_date >= vimb_fee_rate_1.date) AND COALESCE((vimb_fragment.end_date <= ((lead(vimb_fee_rate_1.date) OVER (?) - 1))), (((lead(vimb_fee_rate_1.date) OVER (?) - 1)) IS NULL)) AND (vimb_fee_rate_1.account_id = vimb_customer.id))
  • Rows Removed by Join Filter: 356
56. 0.519 3,224.393 ↓ 356.0 356 1

Nested Loop Left Join (cost=647.44..9,048.07 rows=1 width=232) (actual time=1,454.918..3,224.393 rows=356 loops=1)

57. 0.951 3,221.738 ↓ 356.0 356 1

Merge Left Join (cost=647.16..9,046.08 rows=1 width=224) (actual time=1,454.904..3,221.738 rows=356 loops=1)

  • Merge Cond: (vimb_site.id = vimb_fee_rate.site_id)
  • Join Filter: ((vimb_fragment.start_date >= vimb_fee_rate.date) AND COALESCE((vimb_fragment.end_date <= ((lead(vimb_fee_rate.date) OVER (?) - 1))), (((lead(vimb_fee_rate.date) OVER (?) - 1)) IS NULL)) AND (vimb_fee_rate.account_id = vimb_advertiser.id))
  • Rows Removed by Join Filter: 356
58. 14.300 3,219.751 ↓ 356.0 356 1

Merge Join (cost=615.20..8,998.42 rows=1 width=222) (actual time=1,453.884..3,219.751 rows=356 loops=1)

  • Merge Cond: (vimb_site.id = vimb_section.site_id)
  • Join Filter: (vimb_position.section_id = vimb_section.id)
  • Rows Removed by Join Filter: 39020
59. 17.984 3,188.965 ↓ 218.8 39,376 1

Nested Loop (cost=614.93..9,045.66 rows=180 width=230) (actual time=1,401.231..3,188.965 rows=39,376 loops=1)

60. 0.006 0.421 ↓ 2.0 4 1

Nested Loop (cost=0.27..86.25 rows=2 width=30) (actual time=0.315..0.421 rows=4 loops=1)

61. 0.363 0.363 ↓ 2.0 4 1

Index Scan using vimb_site_pkey on vimb_site (cost=0.27..83.01 rows=2 width=38) (actual time=0.273..0.363 rows=4 loops=1)

  • Filter: ((deleted IS FALSE) AND (owner_id = 91) AND ((network)::text = 'VIDEO'::text))
  • Rows Removed by Filter: 369
62. 0.013 0.052 ↑ 1.0 1 4

Materialize (cost=0.00..3.22 rows=1 width=8) (actual time=0.010..0.013 rows=1 loops=4)

63. 0.039 0.039 ↑ 1.0 1 1

Seq Scan on vimb_site_owner (cost=0.00..3.21 rows=1 width=8) (actual time=0.031..0.039 rows=1 loops=1)

  • Filter: ((deleted IS FALSE) AND (id = 91))
  • Rows Removed by Filter: 107
64. 13.621 3,170.560 ↓ 109.4 9,844 4

Materialize (cost=614.66..8,957.38 rows=90 width=200) (actual time=350.229..792.640 rows=9,844 loops=4)

65. 398.286 3,156.939 ↓ 109.4 9,844 1

Nested Loop Left Join (cost=614.66..8,956.93 rows=90 width=200) (actual time=1,400.909..3,156.939 rows=9,844 loops=1)

  • Join Filter: (anon_2.mediaplan_id = vimb_mediaplan.id)
  • Rows Removed by Join Filter: 3016105
66. 8.781 1,360.805 ↓ 109.4 9,844 1

Nested Loop (cost=612.83..8,476.90 rows=90 width=176) (actual time=177.274..1,360.805 rows=9,844 loops=1)

67. 3.653 1,322.492 ↓ 109.4 9,844 1

Nested Loop (cost=612.55..8,004.53 rows=90 width=168) (actual time=177.265..1,322.492 rows=9,844 loops=1)

68. 6.186 1,289.307 ↓ 108.2 9,844 1

Nested Loop (cost=612.28..7,976.98 rows=91 width=176) (actual time=177.253..1,289.307 rows=9,844 loops=1)

69. 6.345 1,253.589 ↓ 103.6 9,844 1

Nested Loop (cost=612.00..7,947.68 rows=95 width=183) (actual time=177.243..1,253.589 rows=9,844 loops=1)

70. 14.027 1,207.868 ↓ 94.7 9,844 1

Nested Loop (cost=611.72..7,914.88 rows=104 width=183) (actual time=177.234..1,207.868 rows=9,844 loops=1)

71. 25.986 266.015 ↓ 21.5 54,578 1

Nested Loop (cost=611.30..5,079.42 rows=2,535 width=55) (actual time=34.407..266.015 rows=54,578 loops=1)

  • Join Filter: (project.id = vimb_mediaplan.project_id)
72. 21.424 65.204 ↓ 123.0 24,975 1

Hash Join (cost=610.87..1,412.72 rows=203 width=24) (actual time=34.375..65.204 rows=24,975 loops=1)

  • Hash Cond: (vimb_order.project_id = project.id)
73. 9.446 9.446 ↑ 1.0 24,977 1

Seq Scan on vimb_order (cost=0.00..704.36 rows=25,483 width=8) (actual time=0.006..9.446 rows=24,977 loops=1)

  • Filter: (deleted IS FALSE)
  • Rows Removed by Filter: 347
74. 4.906 34.334 ↓ 128.1 24,976 1

Hash (cost=608.44..608.44 rows=195 width=16) (actual time=34.334..34.334 rows=24,976 loops=1)

  • Buckets: 32768 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1427kB
75. 14.586 29.428 ↓ 128.1 24,976 1

Bitmap Heap Scan on project (cost=46.17..608.44 rows=195 width=16) (actual time=15.019..29.428 rows=24,976 loops=1)

  • Recheck Cond: (account_id = ANY ($8))
  • Filter: (deleted IS FALSE)
  • Heap Blocks: exact=1113
76. 14.842 14.842 ↓ 128.1 24,980 1

Bitmap Index Scan on project_account_id_deleted_fkey_idx (cost=0.00..46.12 rows=195 width=0) (actual time=14.842..14.842 rows=24,980 loops=1)

  • Index Cond: ((account_id = ANY ($8)) AND (deleted = false))
77. 174.825 174.825 ↑ 9.0 2 24,975

Index Scan using vimb_mediaplan_project_id_fkey_idx on vimb_mediaplan (cost=0.42..17.84 rows=18 width=55) (actual time=0.004..0.007 rows=2 loops=24,975)

  • Index Cond: (project_id = vimb_order.project_id)
  • Filter: (deleted IS FALSE)
  • Rows Removed by Filter: 0
78. 927.826 927.826 ↓ 0.0 0 54,578

Index Scan using vimb_fragment_mediaplan_id_deleted_fkey_idx on vimb_fragment (cost=0.42..1.11 rows=1 width=136) (actual time=0.015..0.017 rows=0 loops=54,578)

  • Index Cond: ((mediaplan_id = vimb_mediaplan.id) AND (deleted = false))
  • Filter: ((deleted IS FALSE) AND (start_date <= '2018-12-18'::date) AND (end_date >= '2018-12-01'::date))
  • Rows Removed by Filter: 5
79. 39.376 39.376 ↑ 1.0 1 9,844

Index Scan using vimb_position_pkey on vimb_position (cost=0.28..0.31 rows=1 width=16) (actual time=0.003..0.004 rows=1 loops=9,844)

  • Index Cond: (id = vimb_fragment.position_id)
  • Filter: (deleted IS FALSE)
80. 29.532 29.532 ↑ 1.0 1 9,844

Index Scan using vimb_product_pkey on vimb_product (cost=0.28..0.30 rows=1 width=9) (actual time=0.003..0.003 rows=1 loops=9,844)

  • Index Cond: (id = vimb_mediaplan.product_id)
  • Filter: (deleted IS FALSE)
81. 29.532 29.532 ↑ 1.0 1 9,844

Index Scan using advertiser_pkey on advertiser (cost=0.28..0.29 rows=1 width=8) (actual time=0.002..0.003 rows=1 loops=9,844)

  • Index Cond: (id = vimb_mediaplan.advertiser_id)
  • Filter: (deleted IS FALSE)
82. 29.532 29.532 ↑ 1.0 1 9,844

Index Scan using account_pkey on account vimb_advertiser (cost=0.28..5.24 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=9,844)

  • Index Cond: (id = project.account_id)
83. 174.584 1,397.848 ↓ 102.3 307 9,844

Materialize (cost=1.83..475.99 rows=3 width=40) (actual time=0.052..0.142 rows=307 loops=9,844)

84. 0.104 1,223.264 ↓ 102.3 307 1

Subquery Scan on anon_2 (cost=1.83..475.97 rows=3 width=40) (actual time=511.598..1,223.264 rows=307 loops=1)

85. 81.806 1,223.160 ↓ 102.3 307 1

GroupAggregate (cost=1.83..475.94 rows=3 width=200) (actual time=511.596..1,223.160 rows=307 loops=1)

  • Group Key: vimb_mediaplan_1.id
86.          

Initplan (forGroupAggregate)

87. 509.044 509.044 ↑ 1.0 1 1

CTE Scan on mediaplan_cte (cost=0.00..0.02 rows=1 width=32) (actual time=509.043..509.044 rows=1 loops=1)

88. 4.323 632.310 ↓ 2,001.0 6,003 1

Nested Loop (cost=1.81..469.44 rows=3 width=42) (actual time=509.120..632.310 rows=6,003 loops=1)

89. 4.352 609.978 ↓ 1,500.8 6,003 1

Nested Loop (cost=1.67..468.56 rows=4 width=50) (actual time=509.113..609.978 rows=6,003 loops=1)

90. 4.270 587.617 ↓ 1,200.6 6,003 1

Nested Loop (cost=1.40..466.24 rows=5 width=50) (actual time=509.105..587.617 rows=6,003 loops=1)

91. 4.786 565.338 ↓ 1,200.6 6,003 1

Nested Loop (cost=1.12..464.51 rows=5 width=50) (actual time=509.101..565.338 rows=6,003 loops=1)

92. 1.933 530.537 ↓ 1,000.5 6,003 1

Nested Loop (cost=0.84..462.68 rows=6 width=50) (actual time=509.095..530.537 rows=6,003 loops=1)

93. 511.412 511.412 ↓ 38.4 307 1

Index Only Scan using vimb_mediaplan_id_deleted_pkey_idx on vimb_mediaplan vimb_mediaplan_1 (cost=0.42..48.41 rows=8 width=8) (actual time=509.083..511.412 rows=307 loops=1)

  • Index Cond: ((id = ANY ($9)) AND (deleted = false))
  • Filter: (deleted IS FALSE)
  • Heap Fetches: 305
94. 17.192 17.192 ↓ 1.7 20 307

Index Scan using vimb_fragment_mediaplan_id_deleted_fkey_idx on vimb_fragment vimb_fragment_1 (cost=0.42..51.66 rows=12 width=50) (actual time=0.007..0.056 rows=20 loops=307)

  • Index Cond: ((mediaplan_id = vimb_mediaplan_1.id) AND (deleted = false))
  • Filter: (deleted IS FALSE)
95. 30.015 30.015 ↑ 1.0 1 6,003

Index Scan using vimb_position_pkey on vimb_position vimb_position_1 (cost=0.28..0.30 rows=1 width=16) (actual time=0.004..0.005 rows=1 loops=6,003)

  • Index Cond: (id = vimb_fragment_1.position_id)
  • Filter: (deleted IS FALSE)
96. 18.009 18.009 ↑ 1.0 1 6,003

Index Scan using vimb_section_pkey on vimb_section vimb_section_1 (cost=0.27..0.33 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=6,003)

  • Index Cond: (id = vimb_position_1.section_id)
  • Filter: (deleted IS FALSE)
97. 18.009 18.009 ↑ 1.0 1 6,003

Index Scan using vimb_site_pkey on vimb_site vimb_site_1 (cost=0.27..0.45 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=6,003)

  • Index Cond: (id = vimb_section_1.site_id)
  • Filter: (deleted IS FALSE)
98. 18.009 18.009 ↑ 1.0 1 6,003

Index Scan using vimb_site_owner_pkey on vimb_site_owner vimb_site_owner_1 (cost=0.14..0.21 rows=1 width=8) (actual time=0.002..0.003 rows=1 loops=6,003)

  • Index Cond: (id = vimb_site_1.owner_id)
  • Filter: (deleted IS FALSE)
99. 16.486 16.486 ↓ 85.9 39,776 1

Index Scan using vimb_section_site_id_fkey_idx on vimb_section (cost=0.27..42.04 rows=463 width=16) (actual time=0.033..16.486 rows=39,776 loops=1)

100. 0.185 1.036 ↓ 1.8 712 1

Materialize (cost=31.95..46.65 rows=392 width=34) (actual time=0.414..1.036 rows=712 loops=1)

101. 0.425 0.851 ↑ 1.1 359 1

WindowAgg (cost=31.95..41.75 rows=392 width=34) (actual time=0.387..0.851 rows=359 loops=1)

102. 0.280 0.426 ↑ 1.1 360 1

Sort (cost=31.95..32.93 rows=392 width=30) (actual time=0.372..0.426 rows=360 loops=1)

  • Sort Key: vimb_fee_rate.site_id, vimb_fee_rate.account_id, vimb_fee_rate.date
  • Sort Method: quicksort Memory: 54kB
103. 0.146 0.146 ↑ 1.0 382 1

Seq Scan on vimb_fee_rate (cost=0.00..15.07 rows=392 width=30) (actual time=0.009..0.146 rows=382 loops=1)

  • Filter: (deleted IS FALSE)
  • Rows Removed by Filter: 104
104. 2.136 2.136 ↑ 1.0 1 356

Index Scan using account_pkey on account vimb_customer (cost=0.28..1.99 rows=1 width=16) (actual time=0.005..0.006 rows=1 loops=356)

  • Index Cond: (id = vimb_advertiser.parent_id)
105. 0.173 1.135 ↓ 1.8 712 1

Materialize (cost=31.95..46.65 rows=392 width=34) (actual time=0.457..1.135 rows=712 loops=1)

106. 0.463 0.962 ↑ 1.1 359 1

WindowAgg (cost=31.95..41.75 rows=392 width=34) (actual time=0.452..0.962 rows=359 loops=1)

107. 0.321 0.499 ↑ 1.1 360 1

Sort (cost=31.95..32.93 rows=392 width=30) (actual time=0.435..0.499 rows=360 loops=1)

  • Sort Key: vimb_fee_rate_1.site_id, vimb_fee_rate_1.account_id, vimb_fee_rate_1.date
  • Sort Method: quicksort Memory: 54kB
108. 0.178 0.178 ↑ 1.0 382 1

Seq Scan on vimb_fee_rate vimb_fee_rate_1 (cost=0.00..15.07 rows=392 width=30) (actual time=0.007..0.178 rows=382 loops=1)

  • Filter: (deleted IS FALSE)
  • Rows Removed by Filter: 104
109. 2.136 2.136 ↑ 1.0 1 356

Index Scan using account_pkey on account vimb_holding (cost=0.28..1.99 rows=1 width=16) (actual time=0.003..0.006 rows=1 loops=356)

  • Index Cond: (id = vimb_customer.parent_id)
110. 0.155 1.107 ↓ 1.8 712 1

Materialize (cost=31.95..46.65 rows=392 width=34) (actual time=0.442..1.107 rows=712 loops=1)

111. 0.482 0.952 ↑ 1.1 359 1

WindowAgg (cost=31.95..41.75 rows=392 width=34) (actual time=0.437..0.952 rows=359 loops=1)

112. 0.319 0.470 ↑ 1.1 360 1

Sort (cost=31.95..32.93 rows=392 width=30) (actual time=0.421..0.470 rows=360 loops=1)

  • Sort Key: vimb_fee_rate_2.site_id, vimb_fee_rate_2.account_id, vimb_fee_rate_2.date
  • Sort Method: quicksort Memory: 54kB
113. 0.151 0.151 ↑ 1.0 382 1

Seq Scan on vimb_fee_rate vimb_fee_rate_2 (cost=0.00..15.07 rows=392 width=30) (actual time=0.006..0.151 rows=382 loops=1)

  • Filter: (deleted IS FALSE)
  • Rows Removed by Filter: 104
114. 1.780 1.780 ↑ 1.0 1 356

Index Only Scan using account_pkey on account account_7 (cost=0.28..0.58 rows=1 width=8) (actual time=0.003..0.005 rows=1 loops=356)

  • Index Cond: (id = vimb_holding.parent_id)
  • Heap Fetches: 356
115. 0.159 0.981 ↓ 1.8 712 1

Materialize (cost=31.95..46.65 rows=392 width=34) (actual time=0.409..0.981 rows=712 loops=1)

116. 0.381 0.822 ↑ 1.1 359 1

WindowAgg (cost=31.95..41.75 rows=392 width=34) (actual time=0.404..0.822 rows=359 loops=1)

117. 0.286 0.441 ↑ 1.1 360 1

Sort (cost=31.95..32.93 rows=392 width=30) (actual time=0.392..0.441 rows=360 loops=1)

  • Sort Key: vimb_fee_rate_3.site_id, vimb_fee_rate_3.account_id, vimb_fee_rate_3.date
  • Sort Method: quicksort Memory: 54kB
118. 0.155 0.155 ↑ 1.0 382 1

Seq Scan on vimb_fee_rate vimb_fee_rate_3 (cost=0.00..15.07 rows=392 width=30) (actual time=0.007..0.155 rows=382 loops=1)

  • Filter: (deleted IS FALSE)
  • Rows Removed by Filter: 104
119. 0.187 0.598 ↓ 3.5 529 1

Materialize (cost=20.53..26.20 rows=151 width=26) (actual time=0.239..0.598 rows=529 loops=1)

120. 0.167 0.411 ↓ 1.2 176 1

WindowAgg (cost=20.53..24.31 rows=151 width=34) (actual time=0.235..0.411 rows=176 loops=1)

121. 0.130 0.244 ↓ 1.2 177 1

Sort (cost=20.53..20.91 rows=151 width=30) (actual time=0.223..0.244 rows=177 loops=1)

  • Sort Key: vimb_fee_rate_4.site_id, vimb_fee_rate_4.account_id, vimb_fee_rate_4.date
  • Sort Method: quicksort Memory: 40kB
122. 0.114 0.114 ↓ 1.3 197 1

Seq Scan on vimb_fee_rate vimb_fee_rate_4 (cost=0.00..15.07 rows=151 width=30) (actual time=0.008..0.114 rows=197 loops=1)

  • Filter: ((deleted IS FALSE) AND (account_id IS NULL))
  • Rows Removed by Filter: 289