0

MariaDB could be thought as a fork of MySQL

I have some software, written in C, which uses SQLite for some operations. I've implemented MySQL backend as an experiment to hasten DB performance. But surprisingly it was not too fast. Basically, I have a simple table:

CREATE TABLE `events` (
  `id` BIGINT PRIMARY KEY AUTO_INCREMENT,
  `type` VARCHAR(24) NOT NULL,
  `time` VARCHAR(32) NOT NULL
)

There are no explicit foreign keys, no triggers on insert and so on. Then, the simple insert

INSERT INTO `events` (`type`, `time`) VALUES ('abc', '2013-04-19T10:00:00')

takes 50 ms to complete. It is very slow for me, and it means only 20 inserts in second - is this OK? Unfortunately, those inserts are non-relating with each other, and it is not easy to group them with bulk inserts or transactions.

Am I miss something, and those inserts should be much faster? Or it is the expected performance (isn't it very slow)?

For this test, I run both the software and MariaDB 10.0 on the same machine - Core i7 and Debian x64. DB was set up with all defaults. DB type is XtraDB (InnoDB).

I'm not expert with MySQL

I've found a related question: mysql insert was too slow

4

2 回答 2

0

最后,我必须实现一些应用程序级别的事务分组逻辑才能达到所需的性能。据我所知,这种性能是我的硬件所期望的。可能在服务器硬件上会好得多(没有时间测试)。

同样,看起来,这种性能对于单个非事务分组插入是正常的。批量插入、事务等显示完全不同的速度。

于 2013-04-22T10:29:15.213 回答
-1

而不是值中的反引号使用单引号

INSERT INTO `events` (`type`, `time`) VALUES ('abc', '2013-04-19T10:00:00')
于 2013-04-20T19:31:52.740 回答