我在mysql中创建了一个简单的空表create table table1(a int not null,b varchar(20))
命令行下单条执行insert时间就很长,试了几次,0.03sec,0.05sec,0.02sec...
看网上别人测试1000次insert才几秒的时间,我这是mysql配置问题还是别的什么问题呢
另外update时也差不多30ms,20ms的刚刚接触数据库,什么性能方面的问题也不懂,希望大家帮帮我。
万分感谢,万分感谢!!

解决方案 »

  1.   

    批量更新的时候,需要的时间就少。另外,索引,硬件的条件,都会影响到insert和update的。,
      

  2.   

    一样,这个时间并不算差啊。
    mysql> create table table1(a int not null,b varchar(20));
    Query OK, 0 rows affected (0.27 sec)mysql> insert into table1 values (1,'a001');
    Query OK, 1 row affected (0.03 sec)mysql> insert into table1 values (2,'a002');
    Query OK, 1 row affected (0.02 sec)mysql> update table1
        -> set b=concat('xxx00',a);
    Query OK, 2 rows affected (0.08 sec)
    Rows matched: 2  Changed: 2  Warnings: 0mysql>