explain.depesz.com

PostgreSQL's explain analyze made readable

Result: q6xj

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.86..45,837,186.88 rows=3 width=268) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Index Scan using asgp_meter_network_interface_mac_idx on asgp_meter m (cost=0.42..170.44 rows=39 width=25) (actual rows= loops=)

  • Index Cond: ((network_interface_mac)::text = ANY ('{00135003001b14e7,00135003001b14e7,00135003001b14e7,00135003001a473c,00135003001a473c,00135003001a473c,00135003001b0445,00135003001b0445,00135003001db615,00135003001cbb48,00135003001cbb48,00135003001cbb4a,00135003001cbb4a,00135003001cbb30,00135003001cbb30,00135003001ca78d,00135003001ca7a2,00135003001ca770,00135003001c9837,00135003001c9bc1,00135003001c9bc2,00135003001c9bbc,00135003001c9bcd,00135003001d4813,00135003001d4813,00135003001d4437,00135003002ee5e5,00135003001e9b1d,00135003001e9b1d,00135003001e9b1d,00135003001e8d4a,00135003001e96d2,00135003001e8f73,00135003001f5f1f,00135003001f5f1f,00135003001f5f1f,00135003001eb2cf,00135003001f3d85,00135003001f5ed6}'::text[]))
3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.43..1,607.11 rows=351 width=150) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Append (cost=0.00..37.27 rows=351 width=56) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Seq Scan on nwst_network_device_alert_type t (cost=0.00..25.11 rows=311 width=24) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Seq Scan on nwst_network_device_alert_type_hist t_1 (cost=0.00..10.40 rows=40 width=304) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Append (cost=0.43..4.46 rows=1 width=110) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2020_02_network_device_alert_type_id_meter_key on nwst_meter_alert_2020_02 a (cost=0.43..4.46 rows=1 width=110) (actual rows= loops=)

  • Index Cond: ((network_device_alert_type_id = t.network_device_alert_type_id) AND (meter_id = m.meter_id) AND (raised_timestamptz_ts >= '2020-02-14 00:00:00+11'::timestamp with time zone) AND (raised_timestamptz_ts <= '2020-02-14 23:59:59+11'::timestamp with time zone))
9.          

SubPlan (for Nested Loop)

10. 0.000 0.000 ↓ 0.0

Append (cost=0.44..15,258,067.36 rows=23 width=32) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2018_05_nwst_meter_alert_pk on nwst_meter_alert_2018_05 map (cost=0.44..635,842.73 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (meter_alert_id = a.meter_alert_id)
12.          

SubPlan (for Index Scan)

13. 0.000 0.000 ↓ 0.0

HashAggregate (cost=635,838.24..635,838.27 rows=3 width=32) (actual rows= loops=)

  • Group Key: __unnamed_subquery_0.patched
14.          

CTE replaced

15. 0.000 0.000 ↓ 0.0

Recursive Union (cost=635,064.86..635,822.82 rows=82 width=564) (actual rows= loops=)

16.          

CTE replacements

17. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.71..635,064.86 rows=2,300 width=204) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

WindowAgg (cost=0.44..633,867.61 rows=2,300 width=88) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.44..633,833.11 rows=2,300 width=80) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Append (cost=0.44..633,787.11 rows=23 width=77) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2018_05_nwst_meter_alert_pk on nwst_meter_alert_2018_05 mac (cost=0.44..4.46 rows=1 width=105) (actual rows= loops=)

  • Index Cond: (meter_alert_id = map.meter_alert_id)
  • Filter: (argument_js IS NOT NULL)
22. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2018_06_pkey on nwst_meter_alert_2018_06 mac_1 (cost=0.43..4.45 rows=1 width=85) (actual rows= loops=)

  • Index Cond: (meter_alert_id = map.meter_alert_id)
  • Filter: (argument_js IS NOT NULL)
23. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2018_07_pkey on nwst_meter_alert_2018_07 mac_2 (cost=0.43..4.45 rows=1 width=92) (actual rows= loops=)

  • Index Cond: (meter_alert_id = map.meter_alert_id)
  • Filter: (argument_js IS NOT NULL)
24. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2018_08_pkey on nwst_meter_alert_2018_08 mac_3 (cost=0.43..4.45 rows=1 width=83) (actual rows= loops=)

  • Index Cond: (meter_alert_id = map.meter_alert_id)
  • Filter: (argument_js IS NOT NULL)
25. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2018_09_pkey on nwst_meter_alert_2018_09 mac_4 (cost=0.43..4.45 rows=1 width=82) (actual rows= loops=)

  • Index Cond: (meter_alert_id = map.meter_alert_id)
  • Filter: (argument_js IS NOT NULL)
26. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2018_10_pkey on nwst_meter_alert_2018_10 mac_5 (cost=0.43..4.45 rows=1 width=78) (actual rows= loops=)

  • Index Cond: (meter_alert_id = map.meter_alert_id)
  • Filter: (argument_js IS NOT NULL)
27. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2018_11_pkey on nwst_meter_alert_2018_11 mac_6 (cost=0.43..4.45 rows=1 width=76) (actual rows= loops=)

  • Index Cond: (meter_alert_id = map.meter_alert_id)
  • Filter: (argument_js IS NOT NULL)
28. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2018_12_pkey on nwst_meter_alert_2018_12 mac_7 (cost=0.43..4.45 rows=1 width=69) (actual rows= loops=)

  • Index Cond: (meter_alert_id = map.meter_alert_id)
  • Filter: (argument_js IS NOT NULL)
29. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_01_pkey on nwst_meter_alert_2019_01 mac_8 (cost=0.43..4.45 rows=1 width=74) (actual rows= loops=)

  • Index Cond: (meter_alert_id = map.meter_alert_id)
  • Filter: (argument_js IS NOT NULL)
30. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_02_pkey on nwst_meter_alert_2019_02 mac_9 (cost=0.43..4.45 rows=1 width=77) (actual rows= loops=)

  • Index Cond: (meter_alert_id = map.meter_alert_id)
  • Filter: (argument_js IS NOT NULL)
31. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_03_pkey on nwst_meter_alert_2019_03 mac_10 (cost=0.43..4.45 rows=1 width=88) (actual rows= loops=)

  • Index Cond: (meter_alert_id = map.meter_alert_id)
  • Filter: (argument_js IS NOT NULL)
32. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_04_pkey on nwst_meter_alert_2019_04 mac_11 (cost=0.43..4.45 rows=1 width=73) (actual rows= loops=)

  • Index Cond: (meter_alert_id = map.meter_alert_id)
  • Filter: (argument_js IS NOT NULL)
33. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_05_pkey on nwst_meter_alert_2019_05 mac_12 (cost=0.43..4.45 rows=1 width=72) (actual rows= loops=)

  • Index Cond: (meter_alert_id = map.meter_alert_id)
  • Filter: (argument_js IS NOT NULL)
34. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_06_pkey on nwst_meter_alert_2019_06 mac_13 (cost=0.43..4.45 rows=1 width=75) (actual rows= loops=)

  • Index Cond: (meter_alert_id = map.meter_alert_id)
  • Filter: (argument_js IS NOT NULL)
35. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_07_pkey on nwst_meter_alert_2019_07 mac_14 (cost=0.43..4.45 rows=1 width=78) (actual rows= loops=)

  • Index Cond: (meter_alert_id = map.meter_alert_id)
  • Filter: (argument_js IS NOT NULL)
36. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_08_pkey on nwst_meter_alert_2019_08 mac_15 (cost=0.43..4.45 rows=1 width=77) (actual rows= loops=)

  • Index Cond: (meter_alert_id = map.meter_alert_id)
  • Filter: (argument_js IS NOT NULL)
37. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_09_pkey on nwst_meter_alert_2019_09 mac_16 (cost=0.43..4.45 rows=1 width=68) (actual rows= loops=)

  • Index Cond: (meter_alert_id = map.meter_alert_id)
  • Filter: (argument_js IS NOT NULL)
38. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_10_pkey on nwst_meter_alert_2019_10 mac_17 (cost=0.43..4.45 rows=1 width=73) (actual rows= loops=)

  • Index Cond: (meter_alert_id = map.meter_alert_id)
  • Filter: (argument_js IS NOT NULL)
39. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_11_pkey on nwst_meter_alert_2019_11 mac_18 (cost=0.43..4.45 rows=1 width=69) (actual rows= loops=)

  • Index Cond: (meter_alert_id = map.meter_alert_id)
  • Filter: (argument_js IS NOT NULL)
40. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_12_pkey on nwst_meter_alert_2019_12 mac_19 (cost=0.43..4.45 rows=1 width=71) (actual rows= loops=)

  • Index Cond: (meter_alert_id = map.meter_alert_id)
  • Filter: (argument_js IS NOT NULL)
41. 0.000 0.000 ↓ 0.0

Seq Scan on nwst_meter_alert_2020_01 mac_20 (cost=0.00..468,926.10 rows=1 width=74) (actual rows= loops=)

  • Filter: ((argument_js IS NOT NULL) AND (meter_alert_id = map.meter_alert_id))
42. 0.000 0.000 ↓ 0.0

Seq Scan on nwst_meter_alert_2020_02 mac_21 (cost=0.00..164,759.23 rows=1 width=75) (actual rows= loops=)

  • Filter: ((argument_js IS NOT NULL) AND (meter_alert_id = map.meter_alert_id))
43. 0.000 0.000 ↓ 0.0

Seq Scan on nwst_meter_alert_2020_03 mac_22 (cost=0.00..12.62 rows=1 width=48) (actual rows= loops=)

  • Filter: ((argument_js IS NOT NULL) AND (meter_alert_id = map.meter_alert_id))
44. 0.000 0.000 ↓ 0.0

Function Scan on json_each_text kk (cost=0.00..1.00 rows=100 width=64) (actual rows= loops=)

45. 0.000 0.000 ↓ 0.0

Append (cost=0.27..0.49 rows=2 width=132) (actual rows= loops=)

46. 0.000 0.000 ↓ 0.0

Index Scan using nwst_network_device_alert_type_pk on nwst_network_device_alert_type at (cost=0.27..0.31 rows=1 width=82) (actual rows= loops=)

  • Index Cond: (network_device_alert_type_id = mac.network_device_alert_type_id)
47. 0.000 0.000 ↓ 0.0

Index Scan using nwst_network_device_alert_type_hist_pk on nwst_network_device_alert_type_hist at_1 (cost=0.14..0.17 rows=1 width=524) (actual rows= loops=)

  • Index Cond: (network_device_alert_type_id = mac.network_device_alert_type_id)
48. 0.000 0.000 ↓ 0.0

CTE Scan on replacements (cost=0.00..51.84 rows=12 width=564) (actual rows= loops=)

  • Filter: (rn = 1)
49. 0.000 0.000 ↓ 0.0

Hash Join (cost=4.20..70.45 rows=7 width=564) (actual rows= loops=)

  • Hash Cond: ((src.meter_alert_id = repl.meter_alert_id) AND (src.rn = (repl.rn + 1)))
50. 0.000 0.000 ↓ 0.0

CTE Scan on replacements src (cost=0.00..46.00 rows=2,300 width=596) (actual rows= loops=)

51. 0.000 0.000 ↓ 0.0

Hash (cost=2.40..2.40 rows=120 width=48) (actual rows= loops=)

52. 0.000 0.000 ↓ 0.0

WorkTable Scan on replaced repl (cost=0.00..2.40 rows=120 width=48) (actual rows= loops=)

53. 0.000 0.000 ↓ 0.0

Append (cost=4.25..15.41 rows=3 width=32) (actual rows= loops=)

54. 0.000 0.000 ↓ 0.0

Subquery Scan on __unnamed_subquery_0 (cost=4.25..6.91 rows=1 width=32) (actual rows= loops=)

  • Filter: (__unnamed_subquery_0.pn = 1)
55. 0.000 0.000 ↓ 0.0

WindowAgg (cost=4.25..5.89 rows=82 width=572) (actual rows= loops=)

56. 0.000 0.000 ↓ 0.0

Sort (cost=4.25..4.45 rows=82 width=48) (actual rows= loops=)

  • Sort Key: replaced.meter_alert_id, replaced.rn DESC
57. 0.000 0.000 ↓ 0.0

CTE Scan on replaced (cost=0.00..1.64 rows=82 width=48) (actual rows= loops=)

58. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2 (cost=0.27..8.48 rows=2 width=32) (actual rows= loops=)

59. 0.000 0.000 ↓ 0.0

Append (cost=0.27..8.46 rows=2 width=295) (actual rows= loops=)

60. 0.000 0.000 ↓ 0.0

Result (cost=0.27..4.29 rows=1 width=74) (actual rows= loops=)

  • One-Time Filter: (map.argument_js IS NULL)
61. 0.000 0.000 ↓ 0.0

Index Scan using nwst_network_device_alert_type_pk on nwst_network_device_alert_type (cost=0.27..4.29 rows=1 width=74) (actual rows= loops=)

  • Index Cond: (network_device_alert_type_id = map.network_device_alert_type_id)
62. 0.000 0.000 ↓ 0.0

Result (cost=0.14..4.16 rows=1 width=516) (actual rows= loops=)

  • One-Time Filter: (map.argument_js IS NULL)
63. 0.000 0.000 ↓ 0.0

Index Scan using nwst_network_device_alert_type_hist_pk on nwst_network_device_alert_type_hist (cost=0.14..4.16 rows=1 width=516) (actual rows= loops=)

  • Index Cond: (network_device_alert_type_id = map.network_device_alert_type_id)
64. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2018_06_pkey on nwst_meter_alert_2018_06 map_1 (cost=0.43..635,842.72 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (meter_alert_id = a.meter_alert_id)
65. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2018_07_pkey on nwst_meter_alert_2018_07 map_2 (cost=0.43..635,842.72 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (meter_alert_id = a.meter_alert_id)
66. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2018_08_pkey on nwst_meter_alert_2018_08 map_3 (cost=0.43..635,842.72 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (meter_alert_id = a.meter_alert_id)
67. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2018_09_pkey on nwst_meter_alert_2018_09 map_4 (cost=0.43..635,842.72 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (meter_alert_id = a.meter_alert_id)
68. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2018_10_pkey on nwst_meter_alert_2018_10 map_5 (cost=0.43..635,842.72 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (meter_alert_id = a.meter_alert_id)
69. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2018_11_pkey on nwst_meter_alert_2018_11 map_6 (cost=0.43..635,842.72 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (meter_alert_id = a.meter_alert_id)
70. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2018_12_pkey on nwst_meter_alert_2018_12 map_7 (cost=0.43..635,842.72 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (meter_alert_id = a.meter_alert_id)
71. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_01_pkey on nwst_meter_alert_2019_01 map_8 (cost=0.43..635,842.72 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (meter_alert_id = a.meter_alert_id)
72. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_02_pkey on nwst_meter_alert_2019_02 map_9 (cost=0.43..635,842.72 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (meter_alert_id = a.meter_alert_id)
73. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_03_pkey on nwst_meter_alert_2019_03 map_10 (cost=0.43..635,842.72 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (meter_alert_id = a.meter_alert_id)
74. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_04_pkey on nwst_meter_alert_2019_04 map_11 (cost=0.43..635,842.72 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (meter_alert_id = a.meter_alert_id)
75. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_05_pkey on nwst_meter_alert_2019_05 map_12 (cost=0.43..635,842.72 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (meter_alert_id = a.meter_alert_id)
76. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_06_pkey on nwst_meter_alert_2019_06 map_13 (cost=0.43..635,842.72 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (meter_alert_id = a.meter_alert_id)
77. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_07_pkey on nwst_meter_alert_2019_07 map_14 (cost=0.43..635,842.72 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (meter_alert_id = a.meter_alert_id)
78. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_08_pkey on nwst_meter_alert_2019_08 map_15 (cost=0.43..635,842.72 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (meter_alert_id = a.meter_alert_id)
79. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_09_pkey on nwst_meter_alert_2019_09 map_16 (cost=0.43..635,842.72 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (meter_alert_id = a.meter_alert_id)
80. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_10_pkey on nwst_meter_alert_2019_10 map_17 (cost=0.43..635,842.72 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (meter_alert_id = a.meter_alert_id)
81. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_11_pkey on nwst_meter_alert_2019_11 map_18 (cost=0.43..635,842.72 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (meter_alert_id = a.meter_alert_id)
82. 0.000 0.000 ↓ 0.0

Index Scan using nwst_meter_alert_2019_12_pkey on nwst_meter_alert_2019_12 map_19 (cost=0.43..635,842.72 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (meter_alert_id = a.meter_alert_id)
83. 0.000 0.000 ↓ 0.0

Seq Scan on nwst_meter_alert_2020_01 map_20 (cost=0.00..1,104,764.37 rows=1 width=32) (actual rows= loops=)

  • Filter: (meter_alert_id = a.meter_alert_id)
84. 0.000 0.000 ↓ 0.0

Seq Scan on nwst_meter_alert_2020_02 map_21 (cost=0.00..800,597.50 rows=1 width=32) (actual rows= loops=)

  • Filter: (meter_alert_id = a.meter_alert_id)
85. 0.000 0.000 ↓ 0.0

Seq Scan on nwst_meter_alert_2020_03 map_22 (cost=0.00..635,850.90 rows=1 width=32) (actual rows= loops=)

  • Filter: (meter_alert_id = a.meter_alert_id)