From 63a2ba032d402c14fd394cdc3bf1c2005607aa10 Mon Sep 17 00:00:00 2001 From: Pedro Pinto Date: Tue, 10 Nov 2020 10:46:52 -0500 Subject: [PATCH] Cleaned up some queries in md.sql. --- src/data_files/files/spartan/md.sql | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/data_files/files/spartan/md.sql b/src/data_files/files/spartan/md.sql index a5b036859..6246ba5e6 100644 --- a/src/data_files/files/spartan/md.sql +++ b/src/data_files/files/spartan/md.sql @@ -281,16 +281,15 @@ select from top_of_books; -drop view if exists per_symbol_event_counts; -create view per_symbol_event_counts as - +drop view if exists p_of_1sec_price_echo; +create view p_of_1sec_price_echo as with total_events as ( select symbol, count(*) total_count from - price_echoes_t + price_echoes group by symbol), echo_events as ( @@ -298,9 +297,9 @@ select count(*) echo_count, symbol from - price_echoes_t + price_echoes where - (t_time-bid_echo_t_time) < 1000*1000*1000*10 + (t_time-bid_echo_t_time) < 1000*1000*1000*1 group by symbol) select total_events.symbol, @@ -314,3 +313,4 @@ where total_events.symbol=echo_events.symbol order by p; +