- 1、本文档共3页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
While writing Inklog, I’ve been debating with myself regarding my use of the filesystem as a datastore. While the filesystem certainly makes creating, updating, visualizing, backing up, and restoring data much easier than it would be in a database, it adds many hardships. First of all, the convenience of SQL is thrown out the window. While it is nice that using the filesystem doesn’t require a database server, not being able to use a database server means that more programming is involved. Additionally, things like searching through all the entries in the system become difficult, not to mention slow. Another downfall is that the filesystem limits the amount of metadata for each entry that can be kept in a simple fashion.
However, the biggest question on my mind was whether or not using a database server would be faster or slower when performing the most commonly requested actions: getting a list of recent items from the entire system, getting a list of items from a category, and getting one item. I decided to write a test case.
I created 6000 empty files in 20 directories. I also created a table in a mysql database that simulated the filesystem: name, mtime, dir, data. I added indexes on dir, name, and mtime. Then I started testing. In each case the test is run 10 times. Then the average is displayed. For the database tests, mysql_connect is called each time.
Getting the filenames of the 10 most recent entries from the entire system.
FILESYSTEM
TIME: 1.7814919948578TIME: 1.7425200939178TIME: 1.8071219921112TIME: 1.6778069734573TIME: 1.6711789369583TIME: 1.7414019107819TIME: 1.6959699392319TIME: 1.6531630754471TIME: 1.7546479701996TIME: 1.6758890151978TOT TIME: 17.201191902161AVG TIME: 1.5637447183782
DATABASE
TIME: 0.0039100646972656TIME: 0.001039981842041TIME: 0.00095093250274658TIME: 0.00096702575683594TIME: 0.00095295906066895TIME: 0.00098395347595215TIME: 0.0009620189666748TIME: 0.0009760856628418TIME: 0.00094294548034668TIME: 0.00095808506011963TOT TIME: 0.0126
您可能关注的文档
- 数据挖掘主要会议.doc
- 数据的输入和简单的计算.doc
- 数据质量的四种标准详细解说.doc
- 数控专业创重整改的主要内容.doc
- 数控仿真软件在教学中的应用.doc
- 数控切割机的操作步骤.doc
- 数控技术(机电方向)教学实施细则.doc
- 数控技术与制造专业介绍.doc
- 数控加工技术学习要点和方法的探讨.doc
- 数控技术毕业实习报告.doc
- 重庆燃气(600917)公司2024年财务分析研究报告.doc
- 中欣氟材(002915)公司2024年财务分析研究报告.doc
- 中源协和(600645)公司2024年财务分析研究报告.doc
- 中洲控股(000042)公司2024年财务分析研究报告.doc
- 新乳业(002946)公司2024年财务分析研究报告.doc
- 重药控股(000950)公司2024年财务分析研究报告.doc
- 佐力药业(300181)公司2024年财务分析研究报告.doc
- 中天精装(002989)公司2024年财务分析研究报告.doc
- 纵横通信(603602)公司2024年财务分析研究报告.doc
- 洲明科技(300232)公司2024年财务分析研究报告.doc
文档评论(0)