explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Bfr

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 203,524.620 ↓ 356.0 356 1

Merge Left Join (cost=11,897.70..12,890.19 rows=1 width=1,955) (actual time=900.079..203,524.620 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)))
2.          

CTE mediaplan_cte

3. 0.000 381.302 ↑ 1.0 1 1

Aggregate (cost=9,158.76..9,158.77 rows=1 width=32) (actual time=381.302..381.302 rows=1 loops=1)

4.          

Initplan (forAggregate)

5. 0.218 5.435 ↑ 1.0 1 1

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

6. 0.809 5.217 ↓ 374.0 1,496 1

Hash Left Join (cost=1,699.22..2,367.64 rows=4 width=8) (actual time=2.709..5.217 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.416 3.633 ↓ 1.0 1,511 1

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

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

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

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

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

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

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

  • Buckets: 2048 Batches: 1 Memory Usage: 91kB
11. 0.894 0.894 ↓ 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.894 rows=1,589 loops=1)

12. 0.276 0.718 ↓ 1.0 1,589 1

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

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

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

14. 0.217 0.775 ↓ 1.0 1,589 1

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

  • Buckets: 2048 Batches: 1 Memory Usage: 79kB
15. 0.558 0.558 ↓ 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.558 rows=1,589 loops=1)

  • Heap Fetches: 881
16. 0.102 381.042 ↓ 265.5 531 1

Nested Loop (cost=1,116.39..6,791.09 rows=2 width=8) (actual time=131.483..381.042 rows=531 loops=1)

17. 0.031 0.031 ↑ 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.023..0.031 rows=1 loops=1)

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

Nested Loop (cost=1,116.39..6,787.86 rows=2 width=16) (actual time=131.457..380.909 rows=531 loops=1)

  • Join Filter: (vimb_section_2.site_id = vimb_site_2.id)
  • Rows Removed by Join Filter: 63365
19. 4.511 365.553 ↓ 95.1 15,974 1

Nested Loop (cost=1,116.39..6,756.60 rows=168 width=16) (actual time=125.515..365.553 rows=15,974 loops=1)

20. 7.249 329.094 ↓ 87.8 15,974 1

Nested Loop (cost=1,116.12..6,693.89 rows=182 width=16) (actual time=125.507..329.094 rows=15,974 loops=1)

21. 4.142 289.897 ↓ 80.3 15,974 1

Nested Loop (cost=1,115.84..6,633.14 rows=199 width=16) (actual time=125.500..289.897 rows=15,974 loops=1)

22. 1.843 263.235 ↓ 8.7 2,252 1

Nested Loop (cost=1,115.42..5,523.48 rows=258 width=8) (actual time=125.491..263.235 rows=2,252 loops=1)

23. 19.087 256.888 ↓ 8.3 2,252 1

Nested Loop (cost=1,115.14..5,438.07 rows=271 width=16) (actual time=125.483..256.888 rows=2,252 loops=1)

  • Join Filter: (project_1.id = vimb_mediaplan_3.project_id)
24. 12.942 112.901 ↓ 129.4 24,980 1

Hash Join (cost=1,114.71..1,916.45 rows=193 width=16) (actual time=93.725..112.901 rows=24,980 loops=1)

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

Seq Scan on vimb_order vimb_order_1 (cost=0.00..704.36 rows=25,483 width=8) (actual time=0.005..6.260 rows=24,982 loops=1)

  • Filter: (deleted IS FALSE)
  • Rows Removed by Filter: 347
26. 6.587 93.699 ↓ 135.0 24,981 1

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

  • Buckets: 32768 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1232kB
27. 11.078 87.112 ↓ 135.0 24,981 1

Nested Loop (cost=46.45..1,112.40 rows=185 width=8) (actual time=11.039..87.112 rows=24,981 loops=1)

28. 15.202 26.072 ↓ 128.1 24,981 1

Bitmap Heap Scan on project project_1 (cost=46.17..608.44 rows=195 width=16) (actual time=11.026..26.072 rows=24,981 loops=1)

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

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

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

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.002..0.002 rows=1 loops=24,981)

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

Index Scan using vimb_mediaplan_project_id_fkey_idx on vimb_mediaplan vimb_mediaplan_3 (cost=0.42..18.22 rows=2 width=24) (actual time=0.005..0.005 rows=0 loops=24,980)

  • 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. 4.504 4.504 ↑ 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.002..0.002 rows=1 loops=2,252)

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

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

  • Index Cond: (mediaplan_id = vimb_mediaplan_3.id)
34. 31.948 31.948 ↑ 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.002 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.102 0.102 ↑ 1.2 4 1

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

  • Filter: ((deleted IS FALSE) AND (owner_id = 91))
  • Rows Removed by Filter: 369
38.          

Initplan (forMerge Left Join)

39. 0.234 5.431 ↑ 1.0 1 1

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

40. 0.747 5.197 ↓ 374.0 1,496 1

Hash Left Join (cost=1,699.22..2,367.64 rows=4 width=8) (actual time=2.613..5.197 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
41. 0.430 3.658 ↓ 1.0 1,511 1

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

  • Hash Cond: (account_8.parent_id = account_9.id)
42. 0.461 2.479 ↓ 1.0 1,511 1

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

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

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

  • Filter: (deleted IS FALSE)
  • Rows Removed by Filter: 78
44. 0.257 1.018 ↓ 1.0 1,589 1

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

  • Buckets: 2048 Batches: 1 Memory Usage: 91kB
45. 0.761 0.761 ↓ 1.0 1,589 1

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

46. 0.246 0.749 ↓ 1.0 1,589 1

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

  • Buckets: 2048 Batches: 1 Memory Usage: 91kB
47. 0.503 0.503 ↓ 1.0 1,589 1

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

48. 0.248 0.792 ↓ 1.0 1,589 1

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

  • Buckets: 2048 Batches: 1 Memory Usage: 79kB
49. 0.544 0.544 ↓ 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.006..0.544 rows=1,589 loops=1)

  • Heap Fetches: 881
50. 381.308 381.308 ↑ 1.0 1 1

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

51. 1.355 203,307.261 ↓ 356.0 356 1

Merge Left Join (cost=350.72..1,299.27 rows=1 width=1,290) (actual time=898.801..203,307.261 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.849 203,305.167 ↓ 356.0 356 1

Nested Loop Left Join (cost=318.76..1,251.61 rows=1 width=1,298) (actual time=898.172..203,305.167 rows=356 loops=1)

53. 1.359 203,302.894 ↓ 356.0 356 1

Merge Left Join (cost=318.49..1,251.02 rows=1 width=1,298) (actual time=898.162..203,302.894 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.560 203,300.819 ↓ 356.0 356 1

Nested Loop Left Join (cost=286.53..1,203.37 rows=1 width=1,306) (actual time=897.530..203,300.819 rows=356 loops=1)

55. 1.820 203,298.123 ↓ 356.0 356 1

Merge Left Join (cost=286.25..1,201.37 rows=1 width=1,298) (actual time=897.521..203,298.123 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.948 203,295.354 ↓ 356.0 356 1

Nested Loop Left Join (cost=254.30..1,153.71 rows=1 width=1,306) (actual time=896.854..203,295.354 rows=356 loops=1)

57. 27.516 203,291.914 ↓ 356.0 356 1

Nested Loop Left Join (cost=254.02..1,151.72 rows=1 width=1,270) (actual time=896.845..203,291.914 rows=356 loops=1)

  • Join Filter: (vimb_mediaplan_2.id = vimb_mediaplan.id)
  • Rows Removed by Join Filter: 106804
58. 52.161 199,451.282 ↓ 356.0 356 1

Nested Loop Left Join (cost=252.73..744.25 rows=1 width=1,201) (actual time=890.325..199,451.282 rows=356 loops=1)

  • Join Filter: (vimb_mediaplan_1.id = vimb_mediaplan.id)
  • Rows Removed by Join Filter: 108936
59. 1.572 533.249 ↓ 356.0 356 1

Nested Loop (cost=250.90..270.81 rows=1 width=1,009) (actual time=522.335..533.249 rows=356 loops=1)

60. 1.466 524.201 ↓ 356.0 356 1

Merge Left Join (cost=250.90..267.59 rows=1 width=992) (actual time=522.313..524.201 rows=356 loops=1)

  • Merge Cond: ((vimb_site.id = vimb_fee_rate.site_id) AND (vimb_advertiser.id = vimb_fee_rate.account_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)))
61. 3.581 522.075 ↓ 356.0 356 1

Sort (cost=218.95..218.95 rows=1 width=1,000) (actual time=521.574..522.075 rows=356 loops=1)

  • Sort Key: vimb_site.id, vimb_advertiser.id
  • Sort Method: quicksort Memory: 553kB
62. 2.585 518.494 ↓ 356.0 356 1

Nested Loop (cost=3.08..218.94 rows=1 width=1,000) (actual time=386.988..518.494 rows=356 loops=1)

63. 3.933 503.903 ↓ 6,003.0 6,003 1

Nested Loop (cost=2.80..218.47 rows=1 width=929) (actual time=386.862..503.903 rows=6,003 loops=1)

64. 5.427 487.964 ↓ 6,003.0 6,003 1

Nested Loop (cost=2.53..218.12 rows=1 width=895) (actual time=386.856..487.964 rows=6,003 loops=1)

65. 4.322 470.531 ↓ 6,003.0 6,003 1

Nested Loop (cost=2.25..217.81 rows=1 width=872) (actual time=386.849..470.531 rows=6,003 loops=1)

66. 4.095 454.203 ↓ 6,003.0 6,003 1

Nested Loop (cost=1.97..210.50 rows=1 width=806) (actual time=386.841..454.203 rows=6,003 loops=1)

67. 4.861 438.102 ↓ 6,003.0 6,003 1

Nested Loop (cost=1.69..205.41 rows=1 width=814) (actual time=386.834..438.102 rows=6,003 loops=1)

68. 4.229 421.235 ↓ 6,003.0 6,003 1

Nested Loop (cost=1.41..200.16 rows=1 width=778) (actual time=386.828..421.235 rows=6,003 loops=1)

69. 2.052 405.000 ↓ 6,003.0 6,003 1

Nested Loop (cost=1.13..193.85 rows=1 width=756) (actual time=386.820..405.000 rows=6,003 loops=1)

70. 0.140 391.896 ↓ 307.0 307 1

Nested Loop (cost=0.71..141.97 rows=1 width=454) (actual time=386.797..391.896 rows=307 loops=1)

71. 383.160 383.160 ↓ 38.4 307 1

Index Scan using vimb_mediaplan_id_deleted_pkey_idx on vimb_mediaplan (cost=0.42..75.35 rows=8 width=386) (actual time=381.336..383.160 rows=307 loops=1)

  • Index Cond: ((id = ANY ($9)) AND (deleted = false))
  • Filter: (deleted IS FALSE)
72. 8.596 8.596 ↑ 1.0 1 307

Index Scan using project_pkey on project (cost=0.29..8.32 rows=1 width=68) (actual time=0.027..0.028 rows=1 loops=307)

  • Index Cond: (id = vimb_mediaplan.project_id)
  • Filter: ((deleted IS FALSE) AND (account_id = ANY ($8)))
73. 11.052 11.052 ↓ 20.0 20 307

Index Scan using vimb_fragment_mediaplan_id_deleted_fkey_idx on vimb_fragment (cost=0.42..51.88 rows=1 width=310) (actual time=0.006..0.036 rows=20 loops=307)

  • 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))
74. 12.006 12.006 ↑ 1.0 1 6,003

Index Scan using advertiser_pkey on advertiser (cost=0.28..6.29 rows=1 width=38) (actual time=0.002..0.002 rows=1 loops=6,003)

  • Index Cond: (id = vimb_mediaplan.advertiser_id)
  • Filter: (deleted IS FALSE)
75. 12.006 12.006 ↑ 1.0 1 6,003

Index Scan using account_pkey on account vimb_advertiser (cost=0.28..5.24 rows=1 width=44) (actual time=0.002..0.002 rows=1 loops=6,003)

  • Index Cond: (id = project.account_id)
76. 12.006 12.006 ↑ 1.0 1 6,003

Index Scan using vimb_order_project_id_fkey_idx on vimb_order (cost=0.29..5.08 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=6,003)

  • Index Cond: (project_id = project.id)
  • Filter: (deleted IS FALSE)
77. 12.006 12.006 ↑ 1.0 1 6,003

Index Scan using vimb_product_pkey on vimb_product (cost=0.28..7.30 rows=1 width=82) (actual time=0.002..0.002 rows=1 loops=6,003)

  • Index Cond: (id = vimb_mediaplan.product_id)
  • Filter: (deleted IS FALSE)
78. 12.006 12.006 ↑ 1.0 1 6,003

Index Scan using vimb_position_pkey on vimb_position (cost=0.28..0.31 rows=1 width=39) (actual time=0.002..0.002 rows=1 loops=6,003)

  • Index Cond: (id = vimb_fragment.position_id)
  • Filter: (deleted IS FALSE)
79. 12.006 12.006 ↑ 1.0 1 6,003

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

  • Index Cond: (id = vimb_position.section_id)
  • Filter: (deleted IS FALSE)
80. 12.006 12.006 ↓ 0.0 0 6,003

Index Scan using vimb_site_pkey on vimb_site (cost=0.27..0.46 rows=1 width=79) (actual time=0.002..0.002 rows=0 loops=6,003)

  • Index Cond: (id = vimb_section.site_id)
  • Filter: ((deleted IS FALSE) AND (owner_id = 91) AND ((network)::text = 'VIDEO'::text))
  • Rows Removed by Filter: 1
81. 0.065 0.660 ↑ 1.0 377 1

Materialize (cost=31.95..46.65 rows=392 width=24) (actual time=0.310..0.660 rows=377 loops=1)

82. 0.273 0.595 ↑ 1.0 377 1

WindowAgg (cost=31.95..41.75 rows=392 width=62) (actual time=0.303..0.595 rows=377 loops=1)

83. 0.204 0.322 ↑ 1.0 378 1

Sort (cost=31.95..32.93 rows=392 width=20) (actual time=0.290..0.322 rows=378 loops=1)

  • Sort Key: vimb_fee_rate.site_id, vimb_fee_rate.account_id, vimb_fee_rate.date
  • Sort Method: quicksort Memory: 48kB
84. 0.118 0.118 ↑ 1.0 382 1

Seq Scan on vimb_fee_rate (cost=0.00..15.07 rows=392 width=20) (actual time=0.013..0.118 rows=382 loops=1)

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

Seq Scan on vimb_site_owner (cost=0.00..3.21 rows=1 width=33) (actual time=0.013..0.021 rows=1 loops=356)

  • Filter: ((deleted IS FALSE) AND (id = 91))
  • Rows Removed by Filter: 107
86. 164,539.281 198,865.872 ↓ 153.5 307 356

GroupAggregate (cost=1.83..473.40 rows=2 width=200) (actual time=1.613..558.612 rows=307 loops=356)

  • Group Key: vimb_mediaplan_1.id
87.          

Initplan (forGroupAggregate)

88. 0.003 0.003 ↑ 1.0 1 1

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

89. 1,628.700 34,326.588 ↓ 3,001.5 6,003 356

Nested Loop (cost=1.81..469.04 rows=2 width=41) (actual time=0.028..96.423 rows=6,003 loops=356)

90. 2,068.360 28,423.752 ↓ 2,001.0 6,003 356

Nested Loop (cost=1.67..468.38 rows=3 width=49) (actual time=0.025..79.842 rows=6,003 loops=356)

91. 1,962.272 22,081.256 ↓ 1,500.8 6,003 356

Nested Loop (cost=1.40..466.53 rows=4 width=49) (actual time=0.022..62.026 rows=6,003 loops=356)

92. 1,171.596 15,844.848 ↓ 1,500.8 6,003 356

Nested Loop (cost=1.12..465.15 rows=4 width=49) (actual time=0.019..44.508 rows=6,003 loops=356)

93. 571.736 6,124.980 ↓ 1,500.8 6,003 356

Nested Loop (cost=0.85..463.93 rows=4 width=49) (actual time=0.016..17.205 rows=6,003 loops=356)

94. 744.396 744.396 ↓ 38.4 307 356

Index Only Scan using vimb_mediaplan_id_deleted_pkey_idx on vimb_mediaplan vimb_mediaplan_1 (cost=0.42..48.43 rows=8 width=8) (actual time=0.008..2.091 rows=307 loops=356)

  • Index Cond: ((id = ANY ($10)) AND (deleted = false))
  • Filter: (deleted IS FALSE)
  • Heap Fetches: 208616
95. 4,808.848 4,808.848 ↓ 1.7 20 109,292

Index Scan using vimb_fragment_mediaplan_id_deleted_fkey_idx on vimb_fragment vimb_fragment_1 (cost=0.42..51.82 rows=12 width=49) (actual time=0.006..0.044 rows=20 loops=109,292)

  • Index Cond: ((mediaplan_id = vimb_mediaplan_1.id) AND (deleted = false))
  • Filter: (deleted IS FALSE)
96. 8,548.272 8,548.272 ↑ 1.0 1 2,137,068

Index Scan using vimb_position_pkey on vimb_position vimb_position_1 (cost=0.28..0.30 rows=1 width=16) (actual time=0.003..0.004 rows=1 loops=2,137,068)

  • Index Cond: (id = vimb_fragment_1.position_id)
  • Filter: (deleted IS FALSE)
97. 4,274.136 4,274.136 ↑ 1.0 1 2,137,068

Index Scan using vimb_section_pkey on vimb_section vimb_section_1 (cost=0.27..0.33 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=2,137,068)

  • Index Cond: (id = vimb_position_1.section_id)
  • Filter: (deleted IS FALSE)
98. 4,274.136 4,274.136 ↑ 1.0 1 2,137,068

Index Scan using vimb_site_pkey on vimb_site vimb_site_1 (cost=0.27..0.45 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=2,137,068)

  • Index Cond: (id = vimb_section_1.site_id)
  • Filter: (deleted IS FALSE)
99. 4,274.136 4,274.136 ↑ 1.0 1 2,137,068

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.002 rows=1 loops=2,137,068)

  • Index Cond: (id = vimb_site_1.owner_id)
  • Filter: (deleted IS FALSE)
100. 409.041 3,813.116 ↓ 75.2 301 356

GroupAggregate (cost=1.29..407.38 rows=4 width=85) (actual time=0.093..10.711 rows=301 loops=356)

  • Group Key: vimb_mediaplan_2.id
101.          

Initplan (forGroupAggregate)

102. 0.003 0.003 ↑ 1.0 1 1

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

103. 93.984 3,404.072 ↓ 359.8 1,439 356

Nested Loop (cost=1.27..407.27 rows=4 width=83) (actual time=0.030..9.562 rows=1,439 loops=356)

104. 169.100 2,285.520 ↓ 359.8 1,439 356

Nested Loop (cost=1.13..406.53 rows=4 width=62) (actual time=0.025..6.420 rows=1,439 loops=356)

105. 78.676 1,091.852 ↓ 359.8 1,439 356

Nested Loop (cost=0.85..405.30 rows=4 width=29) (actual time=0.018..3.067 rows=1,439 loops=356)

106. 466.716 466.716 ↓ 38.4 307 356

Index Scan using vimb_mediaplan_id_deleted_pkey_idx on vimb_mediaplan vimb_mediaplan_2 (cost=0.42..75.35 rows=8 width=21) (actual time=0.007..1.311 rows=307 loops=356)

  • Index Cond: ((id = ANY ($11)) AND (deleted = false))
  • Filter: (deleted IS FALSE)
107. 546.460 546.460 ↑ 3.0 5 109,292

Index Only Scan using vimb_mediaplan_targeting_mediaplan_id_targeting_id_unq on vimb_mediaplan_targeting vimb_mediaplan_targeting_1 (cost=0.42..41.09 rows=15 width=16) (actual time=0.003..0.005 rows=5 loops=109,292)

  • Index Cond: (mediaplan_id = vimb_mediaplan_2.id)
  • Heap Fetches: 512284
108. 1,024.568 1,024.568 ↑ 1.0 1 512,284

Index Scan using vimb_targeting_pkey on vimb_targeting (cost=0.28..0.30 rows=1 width=49) (actual time=0.002..0.002 rows=1 loops=512,284)

  • Index Cond: (id = vimb_mediaplan_targeting_1.targeting_id)
109. 1,024.568 1,024.568 ↑ 1.0 1 512,284

Index Scan using vimb_targeting_dimension_pkey on vimb_targeting_dimension (cost=0.14..0.17 rows=1 width=37) (actual time=0.002..0.002 rows=1 loops=512,284)

  • Index Cond: (id = vimb_targeting.dimension_id)
  • Filter: (deleted IS FALSE)
110. 2.492 2.492 ↑ 1.0 1 356

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

  • Index Cond: (id = vimb_advertiser.parent_id)
111. 0.363 0.949 ↓ 1.8 712 1

Materialize (cost=31.95..46.65 rows=392 width=24) (actual time=0.284..0.949 rows=712 loops=1)

112. 0.279 0.586 ↑ 1.1 359 1

WindowAgg (cost=31.95..41.75 rows=392 width=62) (actual time=0.278..0.586 rows=359 loops=1)

113. 0.192 0.307 ↑ 1.1 360 1

Sort (cost=31.95..32.93 rows=392 width=20) (actual time=0.266..0.307 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: 48kB
114. 0.115 0.115 ↑ 1.0 382 1

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

  • Filter: (deleted IS FALSE)
  • Rows Removed by Filter: 104
115. 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.004..0.006 rows=1 loops=356)

  • Index Cond: (id = vimb_customer.parent_id)
116. 0.196 0.716 ↓ 1.8 712 1

Materialize (cost=31.95..46.65 rows=392 width=24) (actual time=0.256..0.716 rows=712 loops=1)

117. 0.247 0.520 ↑ 1.1 359 1

WindowAgg (cost=31.95..41.75 rows=392 width=62) (actual time=0.254..0.520 rows=359 loops=1)

118. 0.169 0.273 ↑ 1.1 360 1

Sort (cost=31.95..32.93 rows=392 width=20) (actual time=0.245..0.273 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: 48kB
119. 0.104 0.104 ↑ 1.0 382 1

Seq Scan on vimb_fee_rate vimb_fee_rate_2 (cost=0.00..15.07 rows=392 width=20) (actual time=0.005..0.104 rows=382 loops=1)

  • Filter: (deleted IS FALSE)
  • Rows Removed by Filter: 104
120. 1.424 1.424 ↑ 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.004 rows=1 loops=356)

  • Index Cond: (id = vimb_holding.parent_id)
  • Heap Fetches: 356
121. 0.196 0.739 ↓ 1.8 712 1

Materialize (cost=31.95..46.65 rows=392 width=24) (actual time=0.251..0.739 rows=712 loops=1)

122. 0.252 0.543 ↑ 1.1 359 1

WindowAgg (cost=31.95..41.75 rows=392 width=62) (actual time=0.249..0.543 rows=359 loops=1)

123. 0.183 0.291 ↑ 1.1 360 1

Sort (cost=31.95..32.93 rows=392 width=20) (actual time=0.240..0.291 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: 48kB
124. 0.108 0.108 ↑ 1.0 382 1

Seq Scan on vimb_fee_rate vimb_fee_rate_3 (cost=0.00..15.07 rows=392 width=20) (actual time=0.004..0.108 rows=382 loops=1)

  • Filter: (deleted IS FALSE)
  • Rows Removed by Filter: 104
125. 0.203 0.518 ↓ 3.5 529 1

Materialize (cost=20.53..26.20 rows=151 width=16) (actual time=0.170..0.518 rows=529 loops=1)

126. 0.138 0.315 ↓ 1.2 176 1

WindowAgg (cost=20.53..24.31 rows=151 width=62) (actual time=0.167..0.315 rows=176 loops=1)

127. 0.087 0.177 ↓ 1.2 177 1

Sort (cost=20.53..20.91 rows=151 width=20) (actual time=0.158..0.177 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: 34kB
128. 0.090 0.090 ↓ 1.3 197 1

Seq Scan on vimb_fee_rate vimb_fee_rate_4 (cost=0.00..15.07 rows=151 width=20) (actual time=0.005..0.090 rows=197 loops=1)

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