explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mnHZ

Settings
# exclusive inclusive rows x rows loops node
1. 0.012 12.940 ↑ 1.1 188 1

Limit (cost=1,473.34..1,526.34 rows=200 width=780) (actual time=12.722..12.94 rows=188 loops=1)

2. 0.185 12.928 ↑ 5.7 188 1

Result (cost=1,473.34..1,756.36 rows=1,068 width=780) (actual time=12.72..12.928 rows=188 loops=1)

3. 0.551 12.743 ↑ 5.7 188 1

Sort (cost=1,473.34..1,476.01 rows=1,068 width=872) (actual time=12.711..12.743 rows=188 loops=1)

  • Sort Key: ap.name
  • Sort Method: quicksort Memory: 119kB
4. 0.283 12.192 ↑ 5.7 188 1

WindowAgg (cost=828.93..1,427.18 rows=1,068 width=872) (actual time=12.009..12.192 rows=188 loops=1)

5. 0.065 11.909 ↑ 5.7 188 1

Hash Join (cost=828.93..1,309.7 rows=1,068 width=478) (actual time=9.685..11.909 rows=188 loops=1)

6. 0.455 11.832 ↑ 5.7 188 1

Nested Loop (cost=803.68..1,278.84 rows=1,068 width=511) (actual time=9.662..11.832 rows=188 loops=1)

7. 0.958 9.685 ↑ 5.7 188 1

Hash Join (cost=794.07..1,008.3 rows=1,068 width=495) (actual time=8.11..9.685 rows=188 loops=1)

8. 0.624 0.624 ↑ 1.0 6,212 1

Seq Scan on amazon_current_cogs acc (cost=0..158.12 rows=6,212 width=70) (actual time=0.009..0.624 rows=6,212 loops=1)

9. 0.124 8.103 ↑ 5.7 188 1

Hash (cost=778.05..778.05 rows=1,068 width=489) (actual time=8.09..8.103 rows=188 loops=1)

10. 0.590 7.979 ↑ 5.7 188 1

Hash Join (cost=623.35..778.05 rows=1,068 width=489) (actual time=6.431..7.979 rows=188 loops=1)

11. 0.968 0.968 ↑ 1.0 4,011 1

Seq Scan on demand_forecast df (cost=0..118.11 rows=4,011 width=102) (actual time=0.012..0.968 rows=4,011 loops=1)

12. 0.758 6.421 ↑ 5.7 188 1

Hash (cost=607.33..607.33 rows=1,068 width=453) (actual time=6.408..6.421 rows=188 loops=1)

13. 0.455 5.663 ↑ 5.7 188 1

Hash Join (cost=255.34..607.33 rows=1,068 width=453) (actual time=1.576..5.663 rows=188 loops=1)

14. 1.097 5.184 ↑ 1.0 5,339 1

Hash Join (cost=253.14..579.24 rows=5,339 width=453) (actual time=1.546..5.184 rows=5,339 loops=1)

15. 0.965 2.578 ↑ 1.0 5,339 1

Hash Join (cost=8.89..314.93 rows=5,339 width=353) (actual time=0.036..2.578 rows=5,339 loops=1)

16. 1.594 1.594 ↑ 1.0 5,339 1

Seq Scan on amazon_products ap (cost=0..286.01 rows=5,339 width=236) (actual time=0.015..1.594 rows=5,339 loops=1)

  • Filter: is_valid
17. 0.001 0.019 ↓ 0.0 0 1

Hash (cost=8.88..8.88 rows=1 width=149) (actual time=0.014..0.019 rows=0 loops=1)

18. 0.003 0.018 ↓ 0.0 0 1

Nested Loop (cost=2.76..8.88 rows=1 width=149) (actual time=0.014..0.018 rows=0 loops=1)

19. 0.003 0.010 ↑ 1.0 1 1

Aggregate (cost=2.19..2.2 rows=1 width=33) (actual time=0.01..0.01 rows=1 loops=1)

20. 0.000 0.007 ↑ 1.0 1 1

Limit (cost=0.15..2.17 rows=1 width=33) (actual time=0.007..0.007 rows=1 loops=1)

21. 0.007 0.007 ↑ 1.0 1 1

Index Scan using amazon_sellers_seller_id_marketplace_id_key on amazon_sellers amazon_sellers (cost=0.15..2.17 rows=1 width=33) (actual time=0.006..0.007 rows=1 loops=1)

  • Index Cond: (((seller_id)::text = 'A24BVQ69RJOKWH'::text) AND ((marketplace_id)::text = 'ATVPDKIKX0DER'::text))
  • Filter: (((seller_id)::text ~~ 'A24BVQ69RJOKWH'::text) AND ((marketplace_id)::text ~~ 'ATVPDKIKX0DER'::text))
22. 0.001 0.005 ↓ 0.0 0 1

Nested Loop (cost=0.57..6.67 rows=1 width=181) (actual time=0.003..0.005 rows=0 loops=1)

23. 0.001 0.004 ↓ 0.0 0 1

Nested Loop (cost=0.29..4.36 rows=1 width=128) (actual time=0.003..0.004 rows=0 loops=1)

24. 0.003 0.003 ↓ 0.0 0 1

Index Scan using daily_amazon_inventory_snapshots_p2020_08_05_date_idx on daily_amazon_inventory_snapshots_p2020_08_05 start_inv (cost=0.14..2.16 rows=1 width=160) (actual time=0.002..0.003 rows=0 loops=1)

  • Index Cond: (date = '2020-08-05'::date)
25. 0.000 0.000 ↓ 0.0 0 0

Limit (cost=0.15..2.17 rows=1 width=33) (never executed)

26. 0.000 0.000 ↓ 0.0 0 0

Index Scan using amazon_sellers_seller_id_marketplace_id_key on amazon_sellers amazon_sellers_1 (cost=0.15..2.17 rows=1 width=33) (never executed)

  • Index Cond: (((seller_id)::text = 'A24BVQ69RJOKWH'::text) AND ((marketplace_id)::text = 'ATVPDKIKX0DER'::text))
  • Filter: (((seller_id)::text ~~ 'A24BVQ69RJOKWH'::text) AND ((marketplace_id)::text ~~ 'ATVPDKIKX0DER'::text))
27. 0.000 0.000 ↓ 0.0 0 0

Index Scan using daily_amazon_inventory_snapshots_p2020_09_05_pkey on daily_amazon_inventory_snapshots_p2020_09_05 end_inv (cost=0.28..2.3 rows=1 width=85) (never executed)

  • Index Cond: ((amazon_seller_sha = amazon_sellers.seller_marketplace_sha) AND (amazon_product_sha = start_inv.amazon_product_sha) AND (date = '2020-09-05'::date))
28. 0.014 1.509 ↓ 8.7 26 1

Hash (cost=244.21..244.21 rows=3 width=133) (actual time=1.505..1.509 rows=26 loops=1)

29. 0.005 1.495 ↓ 8.7 26 1

Nested Loop (cost=4.67..244.21 rows=3 width=133) (actual time=0.039..1.495 rows=26 loops=1)

30. 0.001 0.006 ↑ 1.0 1 1

Aggregate (cost=2.19..2.2 rows=1 width=33) (actual time=0.006..0.006 rows=1 loops=1)

31. 0.000 0.005 ↑ 1.0 1 1

Limit (cost=0.15..2.17 rows=1 width=33) (actual time=0.005..0.005 rows=1 loops=1)

32. 0.005 0.005 ↑ 1.0 1 1

Index Scan using amazon_sellers_seller_id_marketplace_id_key on amazon_sellers amazon_sellers_2 (cost=0.15..2.17 rows=1 width=33) (actual time=0.004..0.005 rows=1 loops=1)

  • Index Cond: (((seller_id)::text = 'A24BVQ69RJOKWH'::text) AND ((marketplace_id)::text = 'ATVPDKIKX0DER'::text))
  • Filter: (((seller_id)::text ~~ 'A24BVQ69RJOKWH'::text) AND ((marketplace_id)::text ~~ 'ATVPDKIKX0DER'::text))
33. 0.011 1.484 ↓ 26.0 26 1

Nested Loop (cost=2.48..242.01 rows=1 width=166) (actual time=0.032..1.484 rows=26 loops=1)

34. 0.405 1.415 ↓ 1.1 29 1

Hash Join (cost=2.2..181.82 rows=26 width=83) (actual time=0.021..1.415 rows=29 loops=1)

35. 0.999 0.999 ↑ 1.0 5,245 1

Seq Scan on daily_amazon_sales_metrics_p2020_08_05 start_metrics (cost=0..165.56 rows=5,245 width=116) (actual time=0.007..0.999 rows=5,245 loops=1)

  • Filter: (date = '2020-08-05'::date)
36. 0.003 0.011 ↑ 1.0 1 1

Hash (cost=2.18..2.18 rows=1 width=33) (actual time=0.01..0.011 rows=1 loops=1)

37. 0.001 0.008 ↑ 1.0 1 1

Limit (cost=0.15..2.17 rows=1 width=33) (actual time=0.007..0.008 rows=1 loops=1)

38. 0.007 0.007 ↑ 1.0 1 1

Index Scan using amazon_sellers_seller_id_marketplace_id_key on amazon_sellers amazon_sellers_3 (cost=0.15..2.17 rows=1 width=33) (actual time=0.007..0.007 rows=1 loops=1)

  • Index Cond: (((seller_id)::text = 'A24BVQ69RJOKWH'::text) AND ((marketplace_id)::text = 'ATVPDKIKX0DER'::text))
  • Filter: (((seller_id)::text ~~ 'A24BVQ69RJOKWH'::text) AND ((marketplace_id)::text ~~ 'ATVPDKIKX0DER'::text))
39. 0.058 0.058 ↑ 1.0 1 29

Index Scan using daily_amazon_sales_metrics_p2020_09_05_pkey on daily_amazon_sales_metrics_p2020_09_05 end_metrics (cost=0.28..2.3 rows=1 width=116) (actual time=0.002..0.002 rows=1 loops=29)

  • Index Cond: ((amazon_seller_sha = amazon_sellers_2.seller_marketplace_sha) AND (amazon_product_sha = start_metrics.amazon_product_sha) AND (date = '2020-09-05'::date))
40. 0.004 0.024 ↑ 1.0 1 1

Hash (cost=2.18..2.18 rows=1 width=33) (actual time=0.023..0.024 rows=1 loops=1)

41. 0.001 0.020 ↑ 1.0 1 1

Limit (cost=0.15..2.17 rows=1 width=33) (actual time=0.019..0.02 rows=1 loops=1)

42. 0.019 0.019 ↑ 1.0 1 1

Index Scan using amazon_sellers_seller_id_marketplace_id_key on amazon_sellers amazon_sellers_4 (cost=0.15..2.17 rows=1 width=33) (actual time=0.019..0.019 rows=1 loops=1)

  • Index Cond: (((seller_id)::text = 'A24BVQ69RJOKWH'::text) AND ((marketplace_id)::text = 'ATVPDKIKX0DER'::text))
  • Filter: (((seller_id)::text ~~ 'A24BVQ69RJOKWH'::text) AND ((marketplace_id)::text ~~ 'ATVPDKIKX0DER'::text))
43. 0.153 1.692 ↓ 25.0 25 188

Materialize (cost=9.61..254.52 rows=1 width=49) (actual time=0.001..0.009 rows=25 loops=188)

44. 0.006 1.539 ↓ 25.0 25 1

Nested Loop (cost=9.61..254.52 rows=1 width=49) (actual time=0.093..1.539 rows=25 loops=1)

45. 0.004 0.020 ↑ 1.0 1 1

Aggregate (cost=2.19..2.2 rows=1 width=33) (actual time=0.018..0.02 rows=1 loops=1)

46. 0.002 0.016 ↑ 1.0 1 1

Limit (cost=0.15..2.17 rows=1 width=33) (actual time=0.015..0.016 rows=1 loops=1)

47. 0.014 0.014 ↑ 1.0 1 1

Index Scan using amazon_sellers_seller_id_marketplace_id_key on amazon_sellers amazon_sellers_5 (cost=0.15..2.17 rows=1 width=33) (actual time=0.014..0.014 rows=1 loops=1)

  • Index Cond: (((seller_id)::text = 'A24BVQ69RJOKWH'::text) AND ((marketplace_id)::text = 'ATVPDKIKX0DER'::text))
  • Filter: (((seller_id)::text ~~ 'A24BVQ69RJOKWH'::text) AND ((marketplace_id)::text ~~ 'ATVPDKIKX0DER'::text))
48. 0.005 1.513 ↓ 25.0 25 1

Nested Loop (cost=7.42..252.31 rows=1 width=82) (actual time=0.073..1.513 rows=25 loops=1)

49. 0.002 0.007 ↑ 1.0 1 1

Aggregate (cost=2.19..2.2 rows=1 width=33) (actual time=0.006..0.007 rows=1 loops=1)

50. 0.001 0.005 ↑ 1.0 1 1

Limit (cost=0.15..2.17 rows=1 width=33) (actual time=0.004..0.005 rows=1 loops=1)

51. 0.004 0.004 ↑ 1.0 1 1

Index Scan using amazon_sellers_seller_id_marketplace_id_key on amazon_sellers amazon_sellers_6 (cost=0.15..2.17 rows=1 width=33) (actual time=0.004..0.004 rows=1 loops=1)

  • Index Cond: (((seller_id)::text = 'A24BVQ69RJOKWH'::text) AND ((marketplace_id)::text = 'ATVPDKIKX0DER'::text))
  • Filter: (((seller_id)::text ~~ 'A24BVQ69RJOKWH'::text) AND ((marketplace_id)::text ~~ 'ATVPDKIKX0DER'::text))
52. 0.005 1.501 ↓ 25.0 25 1

Nested Loop (cost=5.23..250.1 rows=1 width=115) (actual time=0.065..1.501 rows=25 loops=1)

53. 0.003 0.007 ↑ 1.0 1 1

Aggregate (cost=2.19..2.2 rows=1 width=33) (actual time=0.006..0.007 rows=1 loops=1)

54. 0.001 0.004 ↑ 1.0 1 1

Limit (cost=0.15..2.17 rows=1 width=33) (actual time=0.004..0.004 rows=1 loops=1)

55. 0.003 0.003 ↑ 1.0 1 1

Index Scan using amazon_sellers_seller_id_marketplace_id_key on amazon_sellers amazon_sellers_7 (cost=0.15..2.17 rows=1 width=33) (actual time=0.003..0.003 rows=1 loops=1)

  • Index Cond: (((seller_id)::text = 'A24BVQ69RJOKWH'::text) AND ((marketplace_id)::text = 'ATVPDKIKX0DER'::text))
  • Filter: (((seller_id)::text ~~ 'A24BVQ69RJOKWH'::text) AND ((marketplace_id)::text ~~ 'ATVPDKIKX0DER'::text))
56. 0.012 1.489 ↓ 25.0 25 1

Nested Loop (cost=3.04..247.89 rows=1 width=148) (actual time=0.057..1.489 rows=25 loops=1)

57. 0.011 1.427 ↓ 25.0 25 1

Nested Loop (cost=2.76..245.58 rows=1 width=177) (actual time=0.048..1.427 rows=25 loops=1)

58. 0.014 1.364 ↓ 26.0 26 1

Nested Loop (cost=2.48..243.26 rows=1 width=107) (actual time=0.038..1.364 rows=26 loops=1)

59. 0.400 1.294 ↓ 1.1 28 1

Hash Join (cost=2.2..183.07 rows=26 width=37) (actual time=0.025..1.294 rows=28 loops=1)

60. 0.883 0.883 ↑ 1.0 5,262 1

Seq Scan on daily_amazon_sales_metrics_p2020_08_08 t28d_inv (cost=0..166.78 rows=5,262 width=70) (actual time=0.006..0.883 rows=5,262 loops=1)

  • Filter: (date = '2020-08-08'::date)
61. 0.004 0.011 ↑ 1.0 1 1

Hash (cost=2.18..2.18 rows=1 width=33) (actual time=0.01..0.011 rows=1 loops=1)

62. 0.001 0.007 ↑ 1.0 1 1

Limit (cost=0.15..2.17 rows=1 width=33) (actual time=0.007..0.007 rows=1 loops=1)

63. 0.006 0.006 ↑ 1.0 1 1

Index Scan using amazon_sellers_seller_id_marketplace_id_key on amazon_sellers amazon_sellers_8 (cost=0.15..2.17 rows=1 width=33) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (((seller_id)::text = 'A24BVQ69RJOKWH'::text) AND ((marketplace_id)::text = 'ATVPDKIKX0DER'::text))
  • Filter: (((seller_id)::text ~~ 'A24BVQ69RJOKWH'::text) AND ((marketplace_id)::text ~~ 'ATVPDKIKX0DER'::text))
64. 0.056 0.056 ↑ 1.0 1 28

Index Scan using daily_amazon_sales_metrics_p2020_09_05_pkey on daily_amazon_sales_metrics_p2020_09_05 end_metrics_1 (cost=0.28..2.3 rows=1 width=70) (actual time=0.002..0.002 rows=1 loops=28)

  • Index Cond: ((amazon_seller_sha = amazon_sellers_7.seller_marketplace_sha) AND (amazon_product_sha = t28d_inv.amazon_product_sha) AND (date = '2020-09-05'::date))
65. 0.052 0.052 ↑ 1.0 1 26

Index Scan using daily_amazon_sales_metrics_p2020_08_29_pkey on daily_amazon_sales_metrics_p2020_08_29 t7d_inv (cost=0.28..2.3 rows=1 width=70) (actual time=0.002..0.002 rows=1 loops=26)

  • Index Cond: ((amazon_seller_sha = amazon_sellers_6.seller_marketplace_sha) AND (amazon_product_sha = end_metrics_1.amazon_product_sha) AND (date = '2020-08-29'::date))
66. 0.050 0.050 ↑ 1.0 1 25

Index Scan using daily_amazon_sales_metrics_p2020_08_22_pkey on daily_amazon_sales_metrics_p2020_08_22 t14d_inv (cost=0.28..2.3 rows=1 width=70) (actual time=0.002..0.002 rows=1 loops=25)

  • Index Cond: ((amazon_seller_sha = amazon_sellers_5.seller_marketplace_sha) AND (amazon_product_sha = end_metrics_1.amazon_product_sha) AND (date = '2020-08-22'::date))
67. 0.005 0.012 ↑ 203.3 3 1

Hash (cost=16.1..16.1 rows=610 width=96) (actual time=0.012..0.012 rows=3 loops=1)

68. 0.007 0.007 ↑ 203.3 3 1

Seq Scan on amazon_current_weeks_of_supply acwos (cost=0..16.1 rows=610 width=96) (actual time=0.007..0.007 rows=3 loops=1)

Planning time : 148.238 ms
Execution time : 13.266 ms