dsfsdfsdfsdfsdf45454 2009-01-13 01:37
浏览 84

在PHP中搜索大数据,所有数字,10亿字节

I was wondering how I could quickly search a data string of up to 1 billion bytes of data. The data is all numeric. Currently, we have the data split into 250k files and the searches using strpos (fastest built-in function) on each file until it finds something. Is there a way I can index to make it go faster? Any suggestions?

Eventually I would like to find multiple occurrences, which, as of now, would be done with the offset parameter on strpos.

Any help would surely lead to recognition where needed.

Thanks! - James Hartig

  • 写回答

5条回答 默认 最新

  • douyi1855 2009-01-13 01:49
    关注

    Well, your tags indicate what you should do (the tag I am referring to is "indexing").

    Basically, you should have separate files which would have the indexes for the data. It would have the data strings that you are looking for, as well as the file and byte positions that it is in.

    You would then access the index, look up your value and then find the location(s) in the original file(s) for the data string, and process from there.

    评论

报告相同问题?

悬赏问题

  • ¥15 Python输入字符串转化为列表排序具体见图,严格按照输入
  • ¥20 XP系统在重新启动后进不去桌面,一直黑屏。
  • ¥15 opencv图像处理,需要四个处理结果图
  • ¥15 无线移动边缘计算系统中的系统模型
  • ¥15 深度学习中的画图问题
  • ¥15 java报错:使用mybatis plus查询一个只返回一条数据的sql,却报错返回了1000多条
  • ¥15 Python报错怎么解决
  • ¥15 simulink如何调用DLL文件
  • ¥15 关于用pyqt6的项目开发该怎么把前段后端和业务层分离
  • ¥30 线性代数的问题,我真的忘了线代的知识了