Note that there are some explanatory texts on larger screens.

plurals
  1. POMysql: Insert and Update both are observed really slow on my local machine
    primarykey
    data
    text
    <p>This is Uday. I have a problem with the write performance with a small innodb table.</p> <pre><code> There is a table called "wlists" on my local machine(mysql 5.1.X). It has 5 attributes and has less than 1000 rows. By default, innodb_flush_log_at_trx_commit is set to 1 ; Now the thing is that every insert/update it is taking 0.04 seconds, this is horrible because i can do just 54K inserts per hour. When innodb_flush_log_at_trx_commit set to 2, its working fine. </code></pre> <p>What to do to get the same performance with innodb_flush attribute set to 1 only..?</p> <pre><code> Here are some other details that may help in addressing this: load on the machine : Quite normal innodb_log_file_size : 1MB innodb_buffer_pool_size : 8MB innodb_thread_concurrency : 8 Query : update wlists set customer_id = 1000 where id = 300; </code></pre> <p>I have tried different options like OPTIMIZE table, increasing the log buffer, checking the network latency but no one worked. I would be really thankfull to those who would help me here.</p> <p>Here are the DESC and EXPLAIN of the table.</p> <pre><code> mysql&gt; DESC wlists ; +-------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | customer_id | int(11) | NO | MUL | NULL | | | name | varchar(45) | YES | | NULL | | | created | datetime | YES | | NULL | | | modified | varchar(255) | YES | | NULL | | +-------------+--------------+------+-----+---------+----------------+ 5 rows in set (0.01 sec) mysql&gt; explain select customer_id from wlists where id = 300 ; +----+-------------+-----------+-------+---------------+---------+---------+-------+------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | ----+-------------+-----------+-------+---------------+---------+---------+-------+------+ | 1 | SIMPLE | wishlists | const | PRIMARY | PRIMARY | 4 | const | 1 | | +----+-------------+-----------+-------+---------------+---------+---------+-------+------+-------+ 1 row in set (0.00 sec) </code></pre> <p>SELECT is working OK. Problem is only with the UPDATE/INSERT. </p> <p>Regards, UDAY </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload