简体   繁体   English

如何在PHP中加速平面文件数据库?

[英]How to speed up Flat File Database in PHP?

I noticed that ffdb in PHP are awfully slow. 我注意到PHP中的ffdb非常慢。 So how would I go about speeding up the ffdb without SQL? 那么,如何在不使用SQL的情况下加快ffdb的速度呢?

Flat file will become more slow the more data it's contain. 平面文件包含的数据越多,速度将越慢。 This is because in order to get a data, the engine need to get all data first into memory, then select the requested data. 这是因为为了获取数据,引擎需要首先将所有数据获取到内存中,然后选择请求的数据。

SQL database have random seek feature, because the data placement is in a known location, plus it have index table. SQL数据库具有随机查找功能,因为数据放置在已知位置,并且具有索引表。 That's why any SQL database is not affected with the number of data stored in it. 这就是为什么任何SQL数据库不受存储在其中的数据量的影响的原因。

You can try sqlite if you need single file database. 如果需要单个文件数据库,则可以尝试sqlite Firefox and Thunderbird use sqlite to store bookmark and browsing history. Firefox和Thunderbird使用sqlite来存储书签和浏览历史记录。

Tokyo Cabinet is amazingly fast for key/value lookups. 东京内阁以惊人的速度进行键/值查找。 There is also the search addition (tyrant) that allows for more complex queries 还有搜索附加项(暴君),允许进行更复杂的查询

http://1978th.net/tokyocabinet/ PHP implementation http://code.google.com/p/phptyrant/ http://1978th.net/tokyocabinet/ PHP实现http://code.google.com/p/phptyrant/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM