Note that there are some explanatory texts on larger screens.

plurals
  1. POmysql performance
    primarykey
    data
    text
    <p>I'm testing MySQL as a replacement for SQL server and I'm running into something really strange. I'm testing both inserts and reads, and maxing out around 50 queries per second either way.</p> <p>My test table looks like:</p> <pre><code>DROP TABLE IF EXISTS `webanalytics`.`test`; CREATE TABLE `webanalytics`.`test` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(45) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=utf8; </code></pre> <p>And my C# test program looks like:</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Text; using MySql.Data.MySqlClient; using System.Diagnostics; namespace ConsoleApplication1 { class Program { const int QUERY_COUNT = 1000; const string CONNECTION_STRING = "server=localhost;database=WebAnalytics;uid=root;pwd=root"; static void Main(string[] args) { using (var db = new MySqlConnection(CONNECTION_STRING)) { db.Open(); using (var cmd = db.CreateCommand()) { cmd.CommandText = "insert into Test(Name) values (?Name);"; cmd.Parameters.AddWithValue("?Name", ""); var timer = new Stopwatch(); timer.Start(); for (var i = 0; i &lt; QUERY_COUNT; i++) { cmd.Parameters["?Name"].Value = "Test" + i; cmd.ExecuteNonQuery(); } timer.Stop(); var rate = QUERY_COUNT / (timer.ElapsedMilliseconds / 1000); Console.WriteLine("Query rate: {0}/s", rate); } } } } } </code></pre> <p>Seems like a rather simple test case. On the install for MySQL, I'm running 32bit with default OLTP standard server settings, though I had to adjust the buffer pool for innodb down from 2G to 1G. I don't get where the bottleneck is. Is the MySQL data connector buggy? A dottrace profile session reveals the following:</p> <p><a href="http://img18.imageshack.us/img18/6812/performance.png" rel="nofollow noreferrer">alt text http://img18.imageshack.us/img18/6812/performance.png</a></p> <p>I don't know the inner details of the MySQL connector, but the calls to mysqldatareader.nextresult confuse me. Why is it reading when I'm executing an insert?</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.
 

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