{"slug":"rest-polling-vs-websocket-market-data","qid":"price_trace","label":"AAPL opening minute: quote updates and distinct prices, second by second","post_title":"REST Polling vs WebSockets for Market Data","post_url":"/blog/rest-polling-vs-websocket-market-data#q-price_trace","columns":["et_second","update_count","distinct_bid_prices","distinct_ask_prices"],"rows":[{"et_second":"09:30:00","update_count":1769,"distinct_bid_prices":78,"distinct_ask_prices":89},{"et_second":"09:30:01","update_count":905,"distinct_bid_prices":48,"distinct_ask_prices":51},{"et_second":"09:30:02","update_count":344,"distinct_bid_prices":29,"distinct_ask_prices":42},{"et_second":"09:30:03","update_count":480,"distinct_bid_prices":21,"distinct_ask_prices":25},{"et_second":"09:30:04","update_count":374,"distinct_bid_prices":37,"distinct_ask_prices":42},{"et_second":"09:30:05","update_count":443,"distinct_bid_prices":41,"distinct_ask_prices":39},{"et_second":"09:30:06","update_count":202,"distinct_bid_prices":22,"distinct_ask_prices":23},{"et_second":"09:30:07","update_count":106,"distinct_bid_prices":11,"distinct_ask_prices":10},{"et_second":"09:30:08","update_count":193,"distinct_bid_prices":33,"distinct_ask_prices":29},{"et_second":"09:30:09","update_count":125,"distinct_bid_prices":26,"distinct_ask_prices":15},{"et_second":"09:30:10","update_count":298,"distinct_bid_prices":34,"distinct_ask_prices":35},{"et_second":"09:30:11","update_count":146,"distinct_bid_prices":12,"distinct_ask_prices":14},{"et_second":"09:30:12","update_count":196,"distinct_bid_prices":12,"distinct_ask_prices":27},{"et_second":"09:30:13","update_count":213,"distinct_bid_prices":15,"distinct_ask_prices":19},{"et_second":"09:30:14","update_count":288,"distinct_bid_prices":18,"distinct_ask_prices":17},{"et_second":"09:30:15","update_count":333,"distinct_bid_prices":25,"distinct_ask_prices":24},{"et_second":"09:30:16","update_count":318,"distinct_bid_prices":22,"distinct_ask_prices":19},{"et_second":"09:30:17","update_count":374,"distinct_bid_prices":13,"distinct_ask_prices":20},{"et_second":"09:30:18","update_count":166,"distinct_bid_prices":15,"distinct_ask_prices":12},{"et_second":"09:30:19","update_count":103,"distinct_bid_prices":21,"distinct_ask_prices":11},{"et_second":"09:30:20","update_count":113,"distinct_bid_prices":8,"distinct_ask_prices":13},{"et_second":"09:30:21","update_count":351,"distinct_bid_prices":17,"distinct_ask_prices":26},{"et_second":"09:30:22","update_count":109,"distinct_bid_prices":21,"distinct_ask_prices":11},{"et_second":"09:30:23","update_count":138,"distinct_bid_prices":12,"distinct_ask_prices":13},{"et_second":"09:30:24","update_count":114,"distinct_bid_prices":13,"distinct_ask_prices":14},{"et_second":"09:30:25","update_count":152,"distinct_bid_prices":13,"distinct_ask_prices":12},{"et_second":"09:30:26","update_count":11,"distinct_bid_prices":2,"distinct_ask_prices":2},{"et_second":"09:30:27","update_count":118,"distinct_bid_prices":15,"distinct_ask_prices":10},{"et_second":"09:30:28","update_count":3,"distinct_bid_prices":1,"distinct_ask_prices":1},{"et_second":"09:30:29","update_count":149,"distinct_bid_prices":13,"distinct_ask_prices":11},{"et_second":"09:30:30","update_count":94,"distinct_bid_prices":15,"distinct_ask_prices":7},{"et_second":"09:30:31","update_count":159,"distinct_bid_prices":25,"distinct_ask_prices":17},{"et_second":"09:30:32","update_count":99,"distinct_bid_prices":12,"distinct_ask_prices":9},{"et_second":"09:30:33","update_count":93,"distinct_bid_prices":6,"distinct_ask_prices":11},{"et_second":"09:30:34","update_count":91,"distinct_bid_prices":15,"distinct_ask_prices":12},{"et_second":"09:30:35","update_count":89,"distinct_bid_prices":12,"distinct_ask_prices":13},{"et_second":"09:30:36","update_count":81,"distinct_bid_prices":10,"distinct_ask_prices":9},{"et_second":"09:30:37","update_count":52,"distinct_bid_prices":11,"distinct_ask_prices":8},{"et_second":"09:30:38","update_count":255,"distinct_bid_prices":36,"distinct_ask_prices":27},{"et_second":"09:30:39","update_count":121,"distinct_bid_prices":21,"distinct_ask_prices":12},{"et_second":"09:30:40","update_count":180,"distinct_bid_prices":17,"distinct_ask_prices":17},{"et_second":"09:30:41","update_count":73,"distinct_bid_prices":14,"distinct_ask_prices":12},{"et_second":"09:30:42","update_count":111,"distinct_bid_prices":17,"distinct_ask_prices":8},{"et_second":"09:30:43","update_count":66,"distinct_bid_prices":5,"distinct_ask_prices":7},{"et_second":"09:30:44","update_count":42,"distinct_bid_prices":8,"distinct_ask_prices":6},{"et_second":"09:30:45","update_count":146,"distinct_bid_prices":15,"distinct_ask_prices":27},{"et_second":"09:30:46","update_count":103,"distinct_bid_prices":11,"distinct_ask_prices":8},{"et_second":"09:30:47","update_count":24,"distinct_bid_prices":3,"distinct_ask_prices":5},{"et_second":"09:30:48","update_count":104,"distinct_bid_prices":9,"distinct_ask_prices":12},{"et_second":"09:30:49","update_count":5,"distinct_bid_prices":2,"distinct_ask_prices":1},{"et_second":"09:30:50","update_count":44,"distinct_bid_prices":4,"distinct_ask_prices":11},{"et_second":"09:30:51","update_count":22,"distinct_bid_prices":3,"distinct_ask_prices":3},{"et_second":"09:30:52","update_count":33,"distinct_bid_prices":4,"distinct_ask_prices":3},{"et_second":"09:30:53","update_count":52,"distinct_bid_prices":9,"distinct_ask_prices":4},{"et_second":"09:30:54","update_count":158,"distinct_bid_prices":22,"distinct_ask_prices":14},{"et_second":"09:30:55","update_count":89,"distinct_bid_prices":13,"distinct_ask_prices":17},{"et_second":"09:30:56","update_count":152,"distinct_bid_prices":15,"distinct_ask_prices":11},{"et_second":"09:30:57","update_count":120,"distinct_bid_prices":9,"distinct_ask_prices":8},{"et_second":"09:30:58","update_count":128,"distinct_bid_prices":17,"distinct_ask_prices":13},{"et_second":"09:30:59","update_count":167,"distinct_bid_prices":19,"distinct_ask_prices":12}],"shape":"table","sql":"SELECT\n    formatDateTime(toTimeZone(toDateTime(sip_timestamp), 'America/New_York'), '%H:%i:%S') AS et_second,\n    count()              AS update_count,\n    uniqExact(bid_price) AS distinct_bid_prices,\n    uniqExact(ask_price) AS distinct_ask_prices\nFROM global_markets.cache_stocks_quotes\nWHERE ticker = 'AAPL'\n  AND sip_timestamp >= '2026-09-15 13:30:00'\n  AND sip_timestamp <  '2026-09-15 13:31:00'\nGROUP BY et_second\nORDER BY et_second","computed_at":"2026-10-09T15:25:31.230892+00:00","elapsed":0.002463172}