explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fJXW

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

Sort (cost=903,596.96..903,596.96 rows=3 width=308) (actual rows= loops=)

  • Sort Key: (CASE WHEN (CASE WHEN ((min(tab_2.price)) IS NULL) THEN (tab.price * tab.quantity) ELSE (((min(tab_2.price)) * tab.price) * tab.quantity) END < CASE WHEN ((min(tab_10.price)) IS NULL) THEN (tab_1.price * tab_1.quantity) ELSE (((min(tab_10.price)) * tab_1.price) * tab_1.quantity) END) THEN (CASE WHEN ((min(tab_2.price)) IS NULL) THEN (tab.price * tab.quantity) ELSE (((min(tab_2.price)) * tab.price) * tab.quantity) END * ((CASE WHEN ((min(tab_2.price)) IS NULL) THEN tab.price ELSE ((min(tab_2.price)) * tab.price) END / CASE WHEN ((min(tab_10.price)) IS NULL) THEN tab_1.price ELSE ((min(tab_10.price)) * tab_1.price) END) - '1'::numeric)) ELSE (CASE WHEN ((min(tab_10.price)) IS NULL) THEN (tab_1.price * tab_1.quantity) ELSE (((min(tab_10.price)) * tab_1.price) * tab_1.quantity) END * ((CASE WHEN ((min(tab_2.price)) IS NULL) THEN tab.price ELSE ((min(tab_2.price)) * tab.price) END / CASE WHEN ((min(tab_10.price)) IS NULL) THEN tab_1.price ELSE ((min(tab_10.price)) * tab_1.price) END) - '1'::numeric)) END) DESC
2. 0.000 0.000 ↓ 0.0

Nested Loop (cost=903,595.97..903,596.93 rows=3 width=308) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=677,346.98..677,347.12 rows=1 width=268) (actual rows= loops=)

  • Join Filter: (((tab.quote_asset)::text <> (tab_1.quote_asset)::text) AND ((tab.base_asset)::text = (tab_1.base_asset)::text))
4. 0.000 0.000 ↓ 0.0

Hash Join (cost=338,673.49..338,673.55 rows=1 width=210) (actual rows= loops=)

  • Hash Cond: ((tab_2.base_asset)::text = (tab.quote_asset)::text)
5. 0.000 0.000 ↓ 0.0

Sort (cost=225,899.02..225,899.03 rows=3 width=104) (actual rows= loops=)

  • Sort Key: (min(tab_2.price))
6. 0.000 0.000 ↓ 0.0

Append (cost=112,949.46..225,899.00 rows=3 width=104) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=112,949.46..112,949.48 rows=1 width=108) (actual rows= loops=)

  • Group Key: tab_2.base_asset, tab_2.quote_asset
8. 0.000 0.000 ↓ 0.0

Sort (cost=112,949.46..112,949.46 rows=1 width=98) (actual rows= loops=)

  • Sort Key: tab_2.base_asset
9. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_2 (cost=110,324.45..112,949.45 rows=1 width=98) (actual rows= loops=)

  • Filter: ((tab_2.rank = 1) AND ((tab_2.type)::text = 'ASKS'::text) AND ((tab_2.quote_asset)::text = 'btc'::text))
10. 0.000 0.000 ↓ 0.0

Unique (cost=110,324.45..111,724.45 rows=70,000 width=702) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Sort (cost=110,324.45..110,499.45 rows=70,000 width=702) (actual rows= loops=)

  • Sort Key: tab_3.exchange, tab_3.base_asset, tab_3.quote_asset, tab_3.price, tab_3.quantity, (row_number() OVER (?)), tab_3.type
12. 0.000 0.000 ↓ 0.0

Append (cost=47,840.06..82,917.67 rows=70,000 width=702) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Sort (cost=47,840.06..47,943.42 rows=41,342 width=39) (actual rows= loops=)

  • Sort Key: tab_3.exchange, (row_number() OVER (?))
14. 0.000 0.000 ↓ 0.0

WindowAgg (cost=43,843.26..44,670.10 rows=41,342 width=39) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Sort (cost=43,843.26..43,946.61 rows=41,342 width=31) (actual rows= loops=)

  • Sort Key: tab_3.exchange, tab_3.price DESC
16. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_3 (cost=38,767.05..40,673.30 rows=41,342 width=31) (actual rows= loops=)

  • Filter: (tab_3.is_last_updated AND (tab_3.quantity <> '0'::numeric))
17. 0.000 0.000 ↓ 0.0

Sort (cost=38,767.05..39,084.76 rows=127,083 width=48) (actual rows= loops=)

  • Sort Key: db.price, (to_timestamp(((db.event_time / 1000))::double precision)) DESC
18. 0.000 0.000 ↓ 0.0

WindowAgg (cost=19,635.92..24,083.83 rows=127,083 width=48) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Sort (cost=19,635.92..19,953.63 rows=127,083 width=39) (actual rows= loops=)

  • Sort Key: db.exchange, db.price, db.event_time DESC
20. 0.000 0.000 ↓ 0.0

Seq Scan on depth_event db (cost=0.00..5,386.70 rows=127,083 width=39) (actual rows= loops=)

  • Filter: ((type)::text = 'BIDS'::text)
21. 0.000 0.000 ↓ 0.0

Sort (cost=34,202.61..34,274.25 rows=28,658 width=39) (actual rows= loops=)

  • Sort Key: tab_4.exchange, (row_number() OVER (?))
22. 0.000 0.000 ↓ 0.0

WindowAgg (cost=31,507.80..32,080.96 rows=28,658 width=39) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Sort (cost=31,507.80..31,579.45 rows=28,658 width=31) (actual rows= loops=)

  • Sort Key: tab_4.exchange, tab_4.price
24. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_4 (cost=28,064.76..29,386.16 rows=28,658 width=31) (actual rows= loops=)

  • Filter: (tab_4.is_last_updated AND (tab_4.quantity <> '0'::numeric))
25. 0.000 0.000 ↓ 0.0

Sort (cost=28,064.76..28,285.00 rows=88,093 width=48) (actual rows= loops=)

  • Sort Key: db_1.price, (to_timestamp(((db_1.event_time / 1000))::double precision)) DESC
26. 0.000 0.000 ↓ 0.0

WindowAgg (cost=15,033.60..18,116.86 rows=88,093 width=48) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Sort (cost=15,033.60..15,253.84 rows=88,093 width=39) (actual rows= loops=)

  • Sort Key: db_1.exchange, db_1.price, db_1.event_time DESC
28. 0.000 0.000 ↓ 0.0

Seq Scan on depth_event db_1 (cost=0.00..5,386.70 rows=88,093 width=39) (actual rows= loops=)

  • Filter: ((type)::text = 'ASKS'::text)
29. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=112,949.46..112,949.48 rows=1 width=108) (actual rows= loops=)

  • Group Key: tab_5.quote_asset, tab_5.base_asset
30. 0.000 0.000 ↓ 0.0

Sort (cost=112,949.46..112,949.46 rows=1 width=98) (actual rows= loops=)

  • Sort Key: tab_5.quote_asset
31. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_5 (cost=110,324.45..112,949.45 rows=1 width=98) (actual rows= loops=)

  • Filter: ((tab_5.rank = 1) AND ((tab_5.type)::text = 'ASKS'::text) AND ((tab_5.base_asset)::text = 'btc'::text))
32. 0.000 0.000 ↓ 0.0

Unique (cost=110,324.45..111,724.45 rows=70,000 width=702) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Sort (cost=110,324.45..110,499.45 rows=70,000 width=702) (actual rows= loops=)

  • Sort Key: tab_6.exchange, tab_6.base_asset, tab_6.quote_asset, tab_6.price, tab_6.quantity, (row_number() OVER (?)), tab_6.type
34. 0.000 0.000 ↓ 0.0

Append (cost=47,840.06..82,917.67 rows=70,000 width=702) (actual rows= loops=)

35. 0.000 0.000 ↓ 0.0

Sort (cost=47,840.06..47,943.42 rows=41,342 width=39) (actual rows= loops=)

  • Sort Key: tab_6.exchange, (row_number() OVER (?))
36. 0.000 0.000 ↓ 0.0

WindowAgg (cost=43,843.26..44,670.10 rows=41,342 width=39) (actual rows= loops=)

37. 0.000 0.000 ↓ 0.0

Sort (cost=43,843.26..43,946.61 rows=41,342 width=31) (actual rows= loops=)

  • Sort Key: tab_6.exchange, tab_6.price DESC
38. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_6 (cost=38,767.05..40,673.30 rows=41,342 width=31) (actual rows= loops=)

  • Filter: (tab_6.is_last_updated AND (tab_6.quantity <> '0'::numeric))
39. 0.000 0.000 ↓ 0.0

Sort (cost=38,767.05..39,084.76 rows=127,083 width=48) (actual rows= loops=)

  • Sort Key: db_2.price, (to_timestamp(((db_2.event_time / 1000))::double precision)) DESC
40. 0.000 0.000 ↓ 0.0

WindowAgg (cost=19,635.92..24,083.83 rows=127,083 width=48) (actual rows= loops=)

41. 0.000 0.000 ↓ 0.0

Sort (cost=19,635.92..19,953.63 rows=127,083 width=39) (actual rows= loops=)

  • Sort Key: db_2.exchange, db_2.price, db_2.event_time DESC
42. 0.000 0.000 ↓ 0.0

Seq Scan on depth_event db_2 (cost=0.00..5,386.70 rows=127,083 width=39) (actual rows= loops=)

  • Filter: ((type)::text = 'BIDS'::text)
43. 0.000 0.000 ↓ 0.0

Sort (cost=34,202.61..34,274.25 rows=28,658 width=39) (actual rows= loops=)

  • Sort Key: tab_7.exchange, (row_number() OVER (?))
44. 0.000 0.000 ↓ 0.0

WindowAgg (cost=31,507.80..32,080.96 rows=28,658 width=39) (actual rows= loops=)

45. 0.000 0.000 ↓ 0.0

Sort (cost=31,507.80..31,579.45 rows=28,658 width=31) (actual rows= loops=)

  • Sort Key: tab_7.exchange, tab_7.price
46. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_7 (cost=28,064.76..29,386.16 rows=28,658 width=31) (actual rows= loops=)

  • Filter: (tab_7.is_last_updated AND (tab_7.quantity <> '0'::numeric))
47. 0.000 0.000 ↓ 0.0

Sort (cost=28,064.76..28,285.00 rows=88,093 width=48) (actual rows= loops=)

  • Sort Key: db_3.price, (to_timestamp(((db_3.event_time / 1000))::double precision)) DESC
48. 0.000 0.000 ↓ 0.0

WindowAgg (cost=15,033.60..18,116.86 rows=88,093 width=48) (actual rows= loops=)

49. 0.000 0.000 ↓ 0.0

Sort (cost=15,033.60..15,253.84 rows=88,093 width=39) (actual rows= loops=)

  • Sort Key: db_3.exchange, db_3.price, db_3.event_time DESC
50. 0.000 0.000 ↓ 0.0

Seq Scan on depth_event db_3 (cost=0.00..5,386.70 rows=88,093 width=39) (actual rows= loops=)

  • Filter: ((type)::text = 'ASKS'::text)
51. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=96) (actual rows= loops=)

52. 0.000 0.000 ↓ 0.0

Hash (cost=112,774.45..112,774.45 rows=2 width=178) (actual rows= loops=)

53. 0.000 0.000 ↓ 0.0

Subquery Scan on tab (cost=110,324.45..112,774.45 rows=2 width=178) (actual rows= loops=)

  • Filter: ((tab.rank = 1) AND ((tab.type)::text = 'ASKS'::text))
54. 0.000 0.000 ↓ 0.0

Unique (cost=110,324.45..111,724.45 rows=70,000 width=702) (actual rows= loops=)

55. 0.000 0.000 ↓ 0.0

Sort (cost=110,324.45..110,499.45 rows=70,000 width=702) (actual rows= loops=)

  • Sort Key: tab_8.exchange, tab_8.base_asset, tab_8.quote_asset, tab_8.price, tab_8.quantity, (row_number() OVER (?)), tab_8.type
56. 0.000 0.000 ↓ 0.0

Append (cost=47,840.06..82,917.67 rows=70,000 width=702) (actual rows= loops=)

57. 0.000 0.000 ↓ 0.0

Sort (cost=47,840.06..47,943.42 rows=41,342 width=39) (actual rows= loops=)

  • Sort Key: tab_8.exchange, (row_number() OVER (?))
58. 0.000 0.000 ↓ 0.0

WindowAgg (cost=43,843.26..44,670.10 rows=41,342 width=39) (actual rows= loops=)

59. 0.000 0.000 ↓ 0.0

Sort (cost=43,843.26..43,946.61 rows=41,342 width=31) (actual rows= loops=)

  • Sort Key: tab_8.exchange, tab_8.price DESC
60. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_8 (cost=38,767.05..40,673.30 rows=41,342 width=31) (actual rows= loops=)

  • Filter: (tab_8.is_last_updated AND (tab_8.quantity <> '0'::numeric))
61. 0.000 0.000 ↓ 0.0

Sort (cost=38,767.05..39,084.76 rows=127,083 width=48) (actual rows= loops=)

  • Sort Key: db_4.price, (to_timestamp(((db_4.event_time / 1000))::double precision)) DESC
62. 0.000 0.000 ↓ 0.0

WindowAgg (cost=19,635.92..24,083.83 rows=127,083 width=48) (actual rows= loops=)

63. 0.000 0.000 ↓ 0.0

Sort (cost=19,635.92..19,953.63 rows=127,083 width=39) (actual rows= loops=)

  • Sort Key: db_4.exchange, db_4.price, db_4.event_time DESC
64. 0.000 0.000 ↓ 0.0

Seq Scan on depth_event db_4 (cost=0.00..5,386.70 rows=127,083 width=39) (actual rows= loops=)

  • Filter: ((type)::text = 'BIDS'::text)
65. 0.000 0.000 ↓ 0.0

Sort (cost=34,202.61..34,274.25 rows=28,658 width=39) (actual rows= loops=)

  • Sort Key: tab_9.exchange, (row_number() OVER (?))
66. 0.000 0.000 ↓ 0.0

WindowAgg (cost=31,507.80..32,080.96 rows=28,658 width=39) (actual rows= loops=)

67. 0.000 0.000 ↓ 0.0

Sort (cost=31,507.80..31,579.45 rows=28,658 width=31) (actual rows= loops=)

  • Sort Key: tab_9.exchange, tab_9.price
68. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_9 (cost=28,064.76..29,386.16 rows=28,658 width=31) (actual rows= loops=)

  • Filter: (tab_9.is_last_updated AND (tab_9.quantity <> '0'::numeric))
69. 0.000 0.000 ↓ 0.0

Sort (cost=28,064.76..28,285.00 rows=88,093 width=48) (actual rows= loops=)

  • Sort Key: db_5.price, (to_timestamp(((db_5.event_time / 1000))::double precision)) DESC
70. 0.000 0.000 ↓ 0.0

WindowAgg (cost=15,033.60..18,116.86 rows=88,093 width=48) (actual rows= loops=)

71. 0.000 0.000 ↓ 0.0

Sort (cost=15,033.60..15,253.84 rows=88,093 width=39) (actual rows= loops=)

  • Sort Key: db_5.exchange, db_5.price, db_5.event_time DESC
72. 0.000 0.000 ↓ 0.0

Seq Scan on depth_event db_5 (cost=0.00..5,386.70 rows=88,093 width=39) (actual rows= loops=)

  • Filter: ((type)::text = 'ASKS'::text)
73. 0.000 0.000 ↓ 0.0

Hash Join (cost=338,673.49..338,673.55 rows=1 width=210) (actual rows= loops=)

  • Hash Cond: ((tab_10.base_asset)::text = (tab_1.quote_asset)::text)
74. 0.000 0.000 ↓ 0.0

Sort (cost=225,899.02..225,899.03 rows=3 width=104) (actual rows= loops=)

  • Sort Key: (min(tab_10.price))
75. 0.000 0.000 ↓ 0.0

Append (cost=112,949.46..225,899.00 rows=3 width=104) (actual rows= loops=)

76. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=112,949.46..112,949.48 rows=1 width=108) (actual rows= loops=)

  • Group Key: tab_10.base_asset, tab_10.quote_asset
77. 0.000 0.000 ↓ 0.0

Sort (cost=112,949.46..112,949.46 rows=1 width=98) (actual rows= loops=)

  • Sort Key: tab_10.base_asset
78. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_10 (cost=110,324.45..112,949.45 rows=1 width=98) (actual rows= loops=)

  • Filter: ((tab_10.rank = 1) AND ((tab_10.type)::text = 'ASKS'::text) AND ((tab_10.quote_asset)::text = 'btc'::text))
79. 0.000 0.000 ↓ 0.0

Unique (cost=110,324.45..111,724.45 rows=70,000 width=702) (actual rows= loops=)

80. 0.000 0.000 ↓ 0.0

Sort (cost=110,324.45..110,499.45 rows=70,000 width=702) (actual rows= loops=)

  • Sort Key: tab_11.exchange, tab_11.base_asset, tab_11.quote_asset, tab_11.price, tab_11.quantity, (row_number() OVER (?)), tab_11.type
81. 0.000 0.000 ↓ 0.0

Append (cost=47,840.06..82,917.67 rows=70,000 width=702) (actual rows= loops=)

82. 0.000 0.000 ↓ 0.0

Sort (cost=47,840.06..47,943.42 rows=41,342 width=39) (actual rows= loops=)

  • Sort Key: tab_11.exchange, (row_number() OVER (?))
83. 0.000 0.000 ↓ 0.0

WindowAgg (cost=43,843.26..44,670.10 rows=41,342 width=39) (actual rows= loops=)

84. 0.000 0.000 ↓ 0.0

Sort (cost=43,843.26..43,946.61 rows=41,342 width=31) (actual rows= loops=)

  • Sort Key: tab_11.exchange, tab_11.price DESC
85. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_11 (cost=38,767.05..40,673.30 rows=41,342 width=31) (actual rows= loops=)

  • Filter: (tab_11.is_last_updated AND (tab_11.quantity <> '0'::numeric))
86. 0.000 0.000 ↓ 0.0

Sort (cost=38,767.05..39,084.76 rows=127,083 width=48) (actual rows= loops=)

  • Sort Key: db_6.price, (to_timestamp(((db_6.event_time / 1000))::double precision)) DESC
87. 0.000 0.000 ↓ 0.0

WindowAgg (cost=19,635.92..24,083.83 rows=127,083 width=48) (actual rows= loops=)

88. 0.000 0.000 ↓ 0.0

Sort (cost=19,635.92..19,953.63 rows=127,083 width=39) (actual rows= loops=)

  • Sort Key: db_6.exchange, db_6.price, db_6.event_time DESC
89. 0.000 0.000 ↓ 0.0

Seq Scan on depth_event db_6 (cost=0.00..5,386.70 rows=127,083 width=39) (actual rows= loops=)

  • Filter: ((type)::text = 'BIDS'::text)
90. 0.000 0.000 ↓ 0.0

Sort (cost=34,202.61..34,274.25 rows=28,658 width=39) (actual rows= loops=)

  • Sort Key: tab_12.exchange, (row_number() OVER (?))
91. 0.000 0.000 ↓ 0.0

WindowAgg (cost=31,507.80..32,080.96 rows=28,658 width=39) (actual rows= loops=)

92. 0.000 0.000 ↓ 0.0

Sort (cost=31,507.80..31,579.45 rows=28,658 width=31) (actual rows= loops=)

  • Sort Key: tab_12.exchange, tab_12.price
93. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_12 (cost=28,064.76..29,386.16 rows=28,658 width=31) (actual rows= loops=)

  • Filter: (tab_12.is_last_updated AND (tab_12.quantity <> '0'::numeric))
94. 0.000 0.000 ↓ 0.0

Sort (cost=28,064.76..28,285.00 rows=88,093 width=48) (actual rows= loops=)

  • Sort Key: db_7.price, (to_timestamp(((db_7.event_time / 1000))::double precision)) DESC
95. 0.000 0.000 ↓ 0.0

WindowAgg (cost=15,033.60..18,116.86 rows=88,093 width=48) (actual rows= loops=)

96. 0.000 0.000 ↓ 0.0

Sort (cost=15,033.60..15,253.84 rows=88,093 width=39) (actual rows= loops=)

  • Sort Key: db_7.exchange, db_7.price, db_7.event_time DESC
97. 0.000 0.000 ↓ 0.0

Seq Scan on depth_event db_7 (cost=0.00..5,386.70 rows=88,093 width=39) (actual rows= loops=)

  • Filter: ((type)::text = 'ASKS'::text)
98. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=112,949.46..112,949.48 rows=1 width=108) (actual rows= loops=)

  • Group Key: tab_13.quote_asset, tab_13.base_asset
99. 0.000 0.000 ↓ 0.0

Sort (cost=112,949.46..112,949.46 rows=1 width=98) (actual rows= loops=)

  • Sort Key: tab_13.quote_asset
100. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_13 (cost=110,324.45..112,949.45 rows=1 width=98) (actual rows= loops=)

  • Filter: ((tab_13.rank = 1) AND ((tab_13.type)::text = 'ASKS'::text) AND ((tab_13.base_asset)::text = 'btc'::text))
101. 0.000 0.000 ↓ 0.0

Unique (cost=110,324.45..111,724.45 rows=70,000 width=702) (actual rows= loops=)

102. 0.000 0.000 ↓ 0.0

Sort (cost=110,324.45..110,499.45 rows=70,000 width=702) (actual rows= loops=)

  • Sort Key: tab_14.exchange, tab_14.base_asset, tab_14.quote_asset, tab_14.price, tab_14.quantity, (row_number() OVER (?)), tab_14.type
103. 0.000 0.000 ↓ 0.0

Append (cost=47,840.06..82,917.67 rows=70,000 width=702) (actual rows= loops=)

104. 0.000 0.000 ↓ 0.0

Sort (cost=47,840.06..47,943.42 rows=41,342 width=39) (actual rows= loops=)

  • Sort Key: tab_14.exchange, (row_number() OVER (?))
105. 0.000 0.000 ↓ 0.0

WindowAgg (cost=43,843.26..44,670.10 rows=41,342 width=39) (actual rows= loops=)

106. 0.000 0.000 ↓ 0.0

Sort (cost=43,843.26..43,946.61 rows=41,342 width=31) (actual rows= loops=)

  • Sort Key: tab_14.exchange, tab_14.price DESC
107. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_14 (cost=38,767.05..40,673.30 rows=41,342 width=31) (actual rows= loops=)

  • Filter: (tab_14.is_last_updated AND (tab_14.quantity <> '0'::numeric))
108. 0.000 0.000 ↓ 0.0

Sort (cost=38,767.05..39,084.76 rows=127,083 width=48) (actual rows= loops=)

  • Sort Key: db_8.price, (to_timestamp(((db_8.event_time / 1000))::double precision)) DESC
109. 0.000 0.000 ↓ 0.0

WindowAgg (cost=19,635.92..24,083.83 rows=127,083 width=48) (actual rows= loops=)

110. 0.000 0.000 ↓ 0.0

Sort (cost=19,635.92..19,953.63 rows=127,083 width=39) (actual rows= loops=)

  • Sort Key: db_8.exchange, db_8.price, db_8.event_time DESC
111. 0.000 0.000 ↓ 0.0

Seq Scan on depth_event db_8 (cost=0.00..5,386.70 rows=127,083 width=39) (actual rows= loops=)

  • Filter: ((type)::text = 'BIDS'::text)
112. 0.000 0.000 ↓ 0.0

Sort (cost=34,202.61..34,274.25 rows=28,658 width=39) (actual rows= loops=)

  • Sort Key: tab_15.exchange, (row_number() OVER (?))
113. 0.000 0.000 ↓ 0.0

WindowAgg (cost=31,507.80..32,080.96 rows=28,658 width=39) (actual rows= loops=)

114. 0.000 0.000 ↓ 0.0

Sort (cost=31,507.80..31,579.45 rows=28,658 width=31) (actual rows= loops=)

  • Sort Key: tab_15.exchange, tab_15.price
115. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_15 (cost=28,064.76..29,386.16 rows=28,658 width=31) (actual rows= loops=)

  • Filter: (tab_15.is_last_updated AND (tab_15.quantity <> '0'::numeric))
116. 0.000 0.000 ↓ 0.0

Sort (cost=28,064.76..28,285.00 rows=88,093 width=48) (actual rows= loops=)

  • Sort Key: db_9.price, (to_timestamp(((db_9.event_time / 1000))::double precision)) DESC
117. 0.000 0.000 ↓ 0.0

WindowAgg (cost=15,033.60..18,116.86 rows=88,093 width=48) (actual rows= loops=)

118. 0.000 0.000 ↓ 0.0

Sort (cost=15,033.60..15,253.84 rows=88,093 width=39) (actual rows= loops=)

  • Sort Key: db_9.exchange, db_9.price, db_9.event_time DESC
119. 0.000 0.000 ↓ 0.0

Seq Scan on depth_event db_9 (cost=0.00..5,386.70 rows=88,093 width=39) (actual rows= loops=)

  • Filter: ((type)::text = 'ASKS'::text)
120. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=96) (actual rows= loops=)

121. 0.000 0.000 ↓ 0.0

Hash (cost=112,774.45..112,774.45 rows=2 width=178) (actual rows= loops=)

122. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_1 (cost=110,324.45..112,774.45 rows=2 width=178) (actual rows= loops=)

  • Filter: ((tab_1.rank = 1) AND ((tab_1.type)::text = 'BIDS'::text))
123. 0.000 0.000 ↓ 0.0

Unique (cost=110,324.45..111,724.45 rows=70,000 width=702) (actual rows= loops=)

124. 0.000 0.000 ↓ 0.0

Sort (cost=110,324.45..110,499.45 rows=70,000 width=702) (actual rows= loops=)

  • Sort Key: tab_16.exchange, tab_16.base_asset, tab_16.quote_asset, tab_16.price, tab_16.quantity, (row_number() OVER (?)), tab_16.type
125. 0.000 0.000 ↓ 0.0

Append (cost=47,840.06..82,917.67 rows=70,000 width=702) (actual rows= loops=)

126. 0.000 0.000 ↓ 0.0

Sort (cost=47,840.06..47,943.42 rows=41,342 width=39) (actual rows= loops=)

  • Sort Key: tab_16.exchange, (row_number() OVER (?))
127. 0.000 0.000 ↓ 0.0

WindowAgg (cost=43,843.26..44,670.10 rows=41,342 width=39) (actual rows= loops=)

128. 0.000 0.000 ↓ 0.0

Sort (cost=43,843.26..43,946.61 rows=41,342 width=31) (actual rows= loops=)

  • Sort Key: tab_16.exchange, tab_16.price DESC
129. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_16 (cost=38,767.05..40,673.30 rows=41,342 width=31) (actual rows= loops=)

  • Filter: (tab_16.is_last_updated AND (tab_16.quantity <> '0'::numeric))
130. 0.000 0.000 ↓ 0.0

Sort (cost=38,767.05..39,084.76 rows=127,083 width=48) (actual rows= loops=)

  • Sort Key: db_10.price, (to_timestamp(((db_10.event_time / 1000))::double precision)) DESC
131. 0.000 0.000 ↓ 0.0

WindowAgg (cost=19,635.92..24,083.83 rows=127,083 width=48) (actual rows= loops=)

132. 0.000 0.000 ↓ 0.0

Sort (cost=19,635.92..19,953.63 rows=127,083 width=39) (actual rows= loops=)

  • Sort Key: db_10.exchange, db_10.price, db_10.event_time DESC
133. 0.000 0.000 ↓ 0.0

Seq Scan on depth_event db_10 (cost=0.00..5,386.70 rows=127,083 width=39) (actual rows= loops=)

  • Filter: ((type)::text = 'BIDS'::text)
134. 0.000 0.000 ↓ 0.0

Sort (cost=34,202.61..34,274.25 rows=28,658 width=39) (actual rows= loops=)

  • Sort Key: tab_17.exchange, (row_number() OVER (?))
135. 0.000 0.000 ↓ 0.0

WindowAgg (cost=31,507.80..32,080.96 rows=28,658 width=39) (actual rows= loops=)

136. 0.000 0.000 ↓ 0.0

Sort (cost=31,507.80..31,579.45 rows=28,658 width=31) (actual rows= loops=)

  • Sort Key: tab_17.exchange, tab_17.price
137. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_17 (cost=28,064.76..29,386.16 rows=28,658 width=31) (actual rows= loops=)

  • Filter: (tab_17.is_last_updated AND (tab_17.quantity <> '0'::numeric))
138. 0.000 0.000 ↓ 0.0

Sort (cost=28,064.76..28,285.00 rows=88,093 width=48) (actual rows= loops=)

  • Sort Key: db_11.price, (to_timestamp(((db_11.event_time / 1000))::double precision)) DESC
139. 0.000 0.000 ↓ 0.0

WindowAgg (cost=15,033.60..18,116.86 rows=88,093 width=48) (actual rows= loops=)

140. 0.000 0.000 ↓ 0.0

Sort (cost=15,033.60..15,253.84 rows=88,093 width=39) (actual rows= loops=)

  • Sort Key: db_11.exchange, db_11.price, db_11.event_time DESC
141. 0.000 0.000 ↓ 0.0

Seq Scan on depth_event db_11 (cost=0.00..5,386.70 rows=88,093 width=39) (actual rows= loops=)

  • Filter: ((type)::text = 'ASKS'::text)
142. 0.000 0.000 ↓ 0.0

Sort (cost=226,248.99..226,249.00 rows=3 width=104) (actual rows= loops=)

  • Sort Key: (min(tab_18.price))
143. 0.000 0.000 ↓ 0.0

Append (cost=110,324.45..226,248.97 rows=3 width=104) (actual rows= loops=)

144. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=110,324.45..113,124.46 rows=1 width=108) (actual rows= loops=)

  • Group Key: tab_18.base_asset, tab_18.quote_asset
145. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_18 (cost=110,324.45..113,124.45 rows=1 width=98) (actual rows= loops=)

  • Filter: ((tab_18.rank = 1) AND ((tab_18.type)::text = 'ASKS'::text) AND ((tab_18.quote_asset)::text = 'btc'::text) AND ((tab_18.base_asset)::text = 'tusd'::text))
146. 0.000 0.000 ↓ 0.0

Unique (cost=110,324.45..111,724.45 rows=70,000 width=702) (actual rows= loops=)

147. 0.000 0.000 ↓ 0.0

Sort (cost=110,324.45..110,499.45 rows=70,000 width=702) (actual rows= loops=)

  • Sort Key: tab_19.exchange, tab_19.base_asset, tab_19.quote_asset, tab_19.price, tab_19.quantity, (row_number() OVER (?)), tab_19.type
148. 0.000 0.000 ↓ 0.0

Append (cost=47,840.06..82,917.67 rows=70,000 width=702) (actual rows= loops=)

149. 0.000 0.000 ↓ 0.0

Sort (cost=47,840.06..47,943.42 rows=41,342 width=39) (actual rows= loops=)

  • Sort Key: tab_19.exchange, (row_number() OVER (?))
150. 0.000 0.000 ↓ 0.0

WindowAgg (cost=43,843.26..44,670.10 rows=41,342 width=39) (actual rows= loops=)

151. 0.000 0.000 ↓ 0.0

Sort (cost=43,843.26..43,946.61 rows=41,342 width=31) (actual rows= loops=)

  • Sort Key: tab_19.exchange, tab_19.price DESC
152. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_19 (cost=38,767.05..40,673.30 rows=41,342 width=31) (actual rows= loops=)

  • Filter: (tab_19.is_last_updated AND (tab_19.quantity <> '0'::numeric))
153. 0.000 0.000 ↓ 0.0

Sort (cost=38,767.05..39,084.76 rows=127,083 width=48) (actual rows= loops=)

  • Sort Key: db_12.price, (to_timestamp(((db_12.event_time / 1000))::double precision)) DESC
154. 0.000 0.000 ↓ 0.0

WindowAgg (cost=19,635.92..24,083.83 rows=127,083 width=48) (actual rows= loops=)

155. 0.000 0.000 ↓ 0.0

Sort (cost=19,635.92..19,953.63 rows=127,083 width=39) (actual rows= loops=)

  • Sort Key: db_12.exchange, db_12.price, db_12.event_time DESC
156. 0.000 0.000 ↓ 0.0

Seq Scan on depth_event db_12 (cost=0.00..5,386.70 rows=127,083 width=39) (actual rows= loops=)

  • Filter: ((type)::text = 'BIDS'::text)
157. 0.000 0.000 ↓ 0.0

Sort (cost=34,202.61..34,274.25 rows=28,658 width=39) (actual rows= loops=)

  • Sort Key: tab_20.exchange, (row_number() OVER (?))
158. 0.000 0.000 ↓ 0.0

WindowAgg (cost=31,507.80..32,080.96 rows=28,658 width=39) (actual rows= loops=)

159. 0.000 0.000 ↓ 0.0

Sort (cost=31,507.80..31,579.45 rows=28,658 width=31) (actual rows= loops=)

  • Sort Key: tab_20.exchange, tab_20.price
160. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_20 (cost=28,064.76..29,386.16 rows=28,658 width=31) (actual rows= loops=)

  • Filter: (tab_20.is_last_updated AND (tab_20.quantity <> '0'::numeric))
161. 0.000 0.000 ↓ 0.0

Sort (cost=28,064.76..28,285.00 rows=88,093 width=48) (actual rows= loops=)

  • Sort Key: db_13.price, (to_timestamp(((db_13.event_time / 1000))::double precision)) DESC
162. 0.000 0.000 ↓ 0.0

WindowAgg (cost=15,033.60..18,116.86 rows=88,093 width=48) (actual rows= loops=)

163. 0.000 0.000 ↓ 0.0

Sort (cost=15,033.60..15,253.84 rows=88,093 width=39) (actual rows= loops=)

  • Sort Key: db_13.exchange, db_13.price, db_13.event_time DESC
164. 0.000 0.000 ↓ 0.0

Seq Scan on depth_event db_13 (cost=0.00..5,386.70 rows=88,093 width=39) (actual rows= loops=)

  • Filter: ((type)::text = 'ASKS'::text)
165. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=110,324.45..113,124.47 rows=1 width=108) (actual rows= loops=)

  • Group Key: tab_21.quote_asset, tab_21.base_asset
166. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_21 (cost=110,324.45..113,124.45 rows=1 width=98) (actual rows= loops=)

  • Filter: ((tab_21.rank = 1) AND ((tab_21.type)::text = 'ASKS'::text) AND ((tab_21.base_asset)::text = 'btc'::text) AND ((tab_21.quote_asset)::text = 'tusd'::text))
167. 0.000 0.000 ↓ 0.0

Unique (cost=110,324.45..111,724.45 rows=70,000 width=702) (actual rows= loops=)

168. 0.000 0.000 ↓ 0.0

Sort (cost=110,324.45..110,499.45 rows=70,000 width=702) (actual rows= loops=)

  • Sort Key: tab_22.exchange, tab_22.base_asset, tab_22.quote_asset, tab_22.price, tab_22.quantity, (row_number() OVER (?)), tab_22.type
169. 0.000 0.000 ↓ 0.0

Append (cost=47,840.06..82,917.67 rows=70,000 width=702) (actual rows= loops=)

170. 0.000 0.000 ↓ 0.0

Sort (cost=47,840.06..47,943.42 rows=41,342 width=39) (actual rows= loops=)

  • Sort Key: tab_22.exchange, (row_number() OVER (?))
171. 0.000 0.000 ↓ 0.0

WindowAgg (cost=43,843.26..44,670.10 rows=41,342 width=39) (actual rows= loops=)

172. 0.000 0.000 ↓ 0.0

Sort (cost=43,843.26..43,946.61 rows=41,342 width=31) (actual rows= loops=)

  • Sort Key: tab_22.exchange, tab_22.price DESC
173. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_22 (cost=38,767.05..40,673.30 rows=41,342 width=31) (actual rows= loops=)

  • Filter: (tab_22.is_last_updated AND (tab_22.quantity <> '0'::numeric))
174. 0.000 0.000 ↓ 0.0

Sort (cost=38,767.05..39,084.76 rows=127,083 width=48) (actual rows= loops=)

  • Sort Key: db_14.price, (to_timestamp(((db_14.event_time / 1000))::double precision)) DESC
175. 0.000 0.000 ↓ 0.0

WindowAgg (cost=19,635.92..24,083.83 rows=127,083 width=48) (actual rows= loops=)

176. 0.000 0.000 ↓ 0.0

Sort (cost=19,635.92..19,953.63 rows=127,083 width=39) (actual rows= loops=)

  • Sort Key: db_14.exchange, db_14.price, db_14.event_time DESC
177. 0.000 0.000 ↓ 0.0

Seq Scan on depth_event db_14 (cost=0.00..5,386.70 rows=127,083 width=39) (actual rows= loops=)

  • Filter: ((type)::text = 'BIDS'::text)
178. 0.000 0.000 ↓ 0.0

Sort (cost=34,202.61..34,274.25 rows=28,658 width=39) (actual rows= loops=)

  • Sort Key: tab_23.exchange, (row_number() OVER (?))
179. 0.000 0.000 ↓ 0.0

WindowAgg (cost=31,507.80..32,080.96 rows=28,658 width=39) (actual rows= loops=)

180. 0.000 0.000 ↓ 0.0

Sort (cost=31,507.80..31,579.45 rows=28,658 width=31) (actual rows= loops=)

  • Sort Key: tab_23.exchange, tab_23.price
181. 0.000 0.000 ↓ 0.0

Subquery Scan on tab_23 (cost=28,064.76..29,386.16 rows=28,658 width=31) (actual rows= loops=)

  • Filter: (tab_23.is_last_updated AND (tab_23.quantity <> '0'::numeric))
182. 0.000 0.000 ↓ 0.0

Sort (cost=28,064.76..28,285.00 rows=88,093 width=48) (actual rows= loops=)

  • Sort Key: db_15.price, (to_timestamp(((db_15.event_time / 1000))::double precision)) DESC
183. 0.000 0.000 ↓ 0.0

WindowAgg (cost=15,033.60..18,116.86 rows=88,093 width=48) (actual rows= loops=)

184. 0.000 0.000 ↓ 0.0

Sort (cost=15,033.60..15,253.84 rows=88,093 width=39) (actual rows= loops=)

  • Sort Key: db_15.exchange, db_15.price, db_15.event_time DESC
185. 0.000 0.000 ↓ 0.0

Seq Scan on depth_event db_15 (cost=0.00..5,386.70 rows=88,093 width=39) (actual rows= loops=)

  • Filter: ((type)::text = 'ASKS'::text)
186. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=96) (actual rows= loops=)

  • One-Time Filter: false