3
我有188万线和188万线的文本文件的表慢,如下图所示SQLITE3:约6X比grep的
CREATE TABLE trigram (count integer, A text, B text, C text)
time echo 'select * from trigram where C="mailman";'|sqlite3 3g.db
18.419 seconds.
time grep 'mailman$' N-Grams/3g
3.137 seconds
或类似
更复杂的查询time grep 'the [^ ]* mailman$' N-Grams/3g
2.879 seconds
time echo 'select * from trigram where A="the" and C="mailman";'|sqlite3 3g.db
15.839 seconds
是有什么办法可以加速sqlite3
?
给berkleydb一个尝试。它应该比sqlite更快,并且瞄准类似的工作流程。 – 2014-10-28 02:35:54
什么版本,操作系统,配置等...? – 2014-11-03 06:24:53
最新Linux Ubuntu和grep sqlite3,但Larry Lustig先生的答案在0.002s执行! – John 2014-11-04 16:03:42