Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
317 views
in Technique[技术] by (71.8m points)

数据去重时out of memory

在DolphinDB database中,dailybar_stock表已经加载到内存,想再做个去重,这个表是八千多万条记录,占1.4GB内存.运行下列语句时OOM(用的server节点是8G内存限制)。

dailybar_stock=select * from?dailybar_stock where isDuplicated([symbol,date],FIRST)=false

请教一下,是否还有别的占用较少内存的办法可以去重?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

可改用下列sql试试:

select top 1 * from t context by date,sym

hashmap比较耗内存。这个context by使用排序算法,节约内存。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...