batch processing - Perform record-matching within a table on FIFO basis -
batch processing - Perform record-matching within a table on FIFO basis -
i have scenario need match records within table on fifo basis. table construction looks below -
table - order_request id, request_type, qty, crtd_ts 10, buy, 15, 15:00 12, buy, 6, 15:25 15, sell, 5, 15:35 16, sell, 6, 16:00 18, buy, 15, 16:30 19, sell, 20, 16:33 20, sell, 4, 17:45 22, sell, 1, 18:02
given sample info above - thought able match records purchase , sell request types, starting oldest, , jumping through records orderly if necessary. so, in case -
id(10), match id(s) 15, 16 , 19 id(12), match id 19 id(18), match id(s) 19, 20 , 22
this table have many records, , wondering best approach is.
should utilize batch framework spring batch sequentially process these records ? won't able leverage parallel or multi-threaded processing, , single-thread processing take long time.
is there way sql ? don't know answer.
any advice or tips ?
thanks!
matching batch-processing fifo self-join
Comments
Post a Comment