SQLite 真的比 MySQL 快吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8789404/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 22:18:03  来源:igfitidea点击:

Is SQLite really faster than MySQL ?

mysqlperformancesqlite

提问by crazyaboutliv

Earlier I was planning on using MySQL for doing some analysis on Netflix and Twitter data. Then I thought of giving SQLite a try. Till now my experience has been :

早些时候,我计划使用 MySQL 对 Netflix 和 Twitter 数据进行一些分析。然后我想尝试一下 SQLite。到目前为止,我的经验是:

  1. Ratio of time to load data from a file with 100,480,057 rows & 4 columns into a DB : MySQL:sqLite :: 1:1.6

  2. Ratio of time to create an index on a given column : MySQL:sqLite :: 1:3

  3. Ratio of dropping a table ( I made a mistake and wanted to drop and restart ) :

  1. 将数据从 100,480,057 行和 4 列的文件加载到数据库中的时间比率:MySQL:sqlite :: 1:1.6

  2. 在给定列上创建索引的时间比率:MySQL:sqlite :: 1:3

  3. 删除表的比率(我犯了一个错误,想删除并重新启动):

The difference is huge. It took a lot of time to drop a table in SQLite.

差别是巨大的。在 SQLite 中删除表需要花费大量时间。

I was under the impression that SQLite faster than MySQL while providing most of the functionalities needed for a normal set of tasks. What am I missing ??

我的印象是 SQLite 比 MySQL 更快,同时提供了一组正常任务所需的大部分功能。我错过了什么?

采纳答案by bpgergo

What made you think that SQLite is faster than MySQL?

是什么让您认为 SQLite 比 MySQL 更快?

I think, the very basic answer to your question would be that the amount of data you're trying to process fits better to MySQL

我认为,您问题的基本答案是您尝试处理的数据量更适合 MySQL

回答by Shawabawa

See this link: http://www.sqlite.org/speed.html

请参阅此链接:http: //www.sqlite.org/speed.html

Note: It's very out of date

注意:它已经过时了

In particular, notice that dropping tables is very slow (which explains 3.)

特别要注意删除表的速度非常慢(这解释了 3。)

Also, all the tests are on relatively small datasets. I imagine most of the speedup would be due to lower latency, but I couldn't say for sure.

此外,所有测试都在相对较小的数据集上进行。我想大部分加速将是由于较低的延迟,但我不能肯定地说。

Also hard disk speed is likely to be a big factor, I imagine you could get a lot of speedup using an SSD

硬盘速度也可能是一个重要因素,我想您可以使用 SSD 获得很多加速