Tag Archive: sql


A very good book by the authors that I admire and appreciate mentioned the use of a class called SQLAsyncResult to access data asynchronously using ADO.NET 2.0 via the callback approach. My attempt to try out an example failed as I couldn’t find the SQLAsyncResult class, not in the namespace, not in the MSDN library. However, I did find a post on ASP.NET forum about a dev’s unsuccessful hunt for this class and an MVP answering that it might be a type in the example.
The reason I’m mentioning it at the start of this post is that, if any one developer finds this class, I would really appetite you leaving a comment.
Now, back to the Callback approach …

This post is in continuation to my previous post about Asynchronous data access using ADO.NET however, that post need not be referred if you are interesting in the callback only.
In this approach we leverage .NET infrastructure relating to threading, AsyncCallback delegate, the AsyncResult class and the IAsyncResult interface.
The approach is accomplished by:

  • Creating a call back method which will process the data (essentially call the end invoke command) which accepts the IAsyncResult
  • Creating an AsyncCallback delegate for the callback methods created &
  • Passing the delegate along with the command object in the begin invoke command.

Here’s a simple implementation of the call back approach:
The model class to load data:

public class Customer {

    public Customer() {
    }

    public Customer(SqlDataReader reader) {

        CustomerID = reader["CustomerID"].ToString();
        CompanyName = reader["CompanyName"] == null ? string.Empty : reader["CompanyName"].ToString();
        ContactName = reader["ContactName"] == null ? string.Empty : reader["ContactName"].ToString();
        Phone = reader["Phone"] == null ? string.Empty : reader["Phone"].ToString();
    }

    public string CustomerID { get; set; }
    public string CompanyName { get; set; }
    public string ContactName { get; set; }
    public string Phone { get; set; }

}

Here’s the data access class that fetches customer asynchronously using the callback approach:

public class CustomerDB {

    /// <summary>
    /// This variable keeps the track of number of asynchronous calls
    /// </summary>
    private static int counter = 0;

    /// <summary>
    /// Class member to store the result.
    /// </summary>
    private List<Customer> _customers = new List<Customer>();

    /// <summary>
    /// This is the main method that needs to be called from other application layer to get Customers.
    /// </summary>
    /// <returns></returns>
    public List<Customer> GetCustomers() {

        //Initiate Connection
        SqlConnection con = new SqlConnection();
        con.ConnectionString = ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString;

        //Initiate Command
        SqlCommand cmd = con.CreateCommand();
        cmd.CommandText = "SELECT top 10 * FROM [Customers]";
        cmd.CommandType = CommandType.Text;

        try {

            con.Open();

            // create AsyncCallback delegate
            AsyncCallback callback = new AsyncCallback(RetrieveDataCallback);

            cmd.BeginExecuteReader(callback, cmd, CommandBehavior.CloseConnection);

            //Wait until the call is complete
            while (counter < 1) {
            }

        }
        catch {
            //Log error
        }

        return _customers;

    }

    /// <summary>
    /// The callback method to retrieve data.
    /// </summary>
    /// <param name="result"></param>
    private void RetrieveDataCallback(IAsyncResult result) {

        SqlDataReader dr = null;

        try {
            SqlCommand command = (SqlCommand)result.AsyncState;
            Customer customer = null;

            dr = command.EndExecuteReader(result);

            while (dr.Read()) {

                customer = new Customer(dr);
                _customers.Add(customer);
            }
        }
        catch {
            //Log error
        }
        finally {

            try {
                if (!dr.IsClosed) {
                    dr.Close();
                }
            }
            catch { } //Suppress any exceptions here

            //Increment value to notify that the call is complete.
            Interlocked.Increment(ref counter);

        }
    }
}

Let’s rewrite this code to make multiple calls to different databases using the same customer model class. To make sure that the data access is thread safe we need to add a static object. This static object needs to be locked every time a thread completes and attempts to update the Customers list. Here’s the new CustomerDB class:

public class CustomerDB {

    /// <summary>
    /// static object for thread safety.
    /// </summary>
    static object lockObject = new object();

    /// <summary>
    /// This variable keeps the track of number of asynchronous calls
    /// </summary>
    private static int counter = 0;

    /// <summary>
    /// Class member to store the result.
    /// </summary>
    private List<Customer> _customers = new List<Customer>();

    /// <summary>
    /// This is the main method that needs to be called from other application layer to get Customers.
    /// </summary>
    /// <returns></returns>
    public List<Customer> GetCustomers() {

        //Initiate Connection
        SqlConnection con1 = new SqlConnection();
        con1.ConnectionString = ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString;
        SqlConnection con2 = new SqlConnection();
        con1.ConnectionString = ConfigurationManager.ConnectionStrings["SouthwindConnectionString"].ConnectionString;
        SqlConnection con3 = new SqlConnection();
        con1.ConnectionString = ConfigurationManager.ConnectionStrings["EastwindConnectionString"].ConnectionString;

        //Initiate Command
        SqlCommand cmd1 = con1.CreateCommand();
        SqlCommand cmd2 = con2.CreateCommand();
        SqlCommand cmd3 = con3.CreateCommand();

        //The table structures are same in my case.
        //In case of different table structures include logic in the call back method
        //or Customer constructor to DB specific load.
        cmd1.CommandText = "SELECT top 10 * FROM [Customers]";
        cmd1.CommandType = CommandType.Text;
        cmd2.CommandText = "SELECT top 10 * FROM [Customers]";
        cmd2.CommandType = CommandType.Text;
        cmd3.CommandText = "SELECT top 10 * FROM [Customers]";
        cmd3.CommandType = CommandType.Text;

        try {

            con1.Open();
            con2.Open();
            con3.Open();

            // create AsyncCallback delegate
            AsyncCallback callback1 = new AsyncCallback(RetrieveDataCallback);
            AsyncCallback callback2 = new AsyncCallback(RetrieveDataCallback);
            AsyncCallback callback3 = new AsyncCallback(RetrieveDataCallback);

            cmd1.BeginExecuteReader(callback1, cmd1, CommandBehavior.CloseConnection);
            cmd2.BeginExecuteReader(callback2, cmd2, CommandBehavior.CloseConnection);
            cmd3.BeginExecuteReader(callback3, cmd3, CommandBehavior.CloseConnection);

            //Wait until all the call are complete
            while (counter < 3) {
            }

        }
        catch {
            //Log error
        }

        return _customers;

    }

    /// <summary>
    /// The callback method to retrieve data.
    /// </summary>
    /// <param name="result"></param>
    private void RetrieveDataCallback(IAsyncResult result) {

        SqlDataReader dr = null;

        try {
            SqlCommand command = (SqlCommand)result.AsyncState;
            Customer customer = null;

            dr = command.EndExecuteReader(result);

            while (dr.Read()) {

                customer = new Customer(dr);

                // lock the static object when data is loaded
                lock (lockObject) {

                    _customers.Add(customer);
                }

            }
        }
        catch {
            //Log error
        }
        finally {

            try {
                if (!dr.IsClosed) {
                    dr.Close();
                }
            }
            catch { } //Suppress any exceptions here

            //Increment value to notify that the call is complete.
            Interlocked.Increment(ref counter);

        }
    }
}

Asynchronous Data Access using ADO.NET

ADO.NET 2.0 enabled the infrastructure required for accessing data in asynchronous mode.

Three standard approaches available to achieve this are:

  • The Poll approach,
  • The Wait approach &
  • The Callback approach.

The approach to choose will depend upon the scenario. Between the Poll and Wait approaches, the Wait approach is better. It provides a great deal of flexibility and efficiency with a bit more complexity than the other. The Callback approach is extreme and runs more in parallel to the multi threading and other asynchronous process paradigm. It helps creating asynchronous/multithreaded data access mechanism even outside SQL/ADO.NET. Drivers and Frameworks which do not come with asynchronous infrastructure.

To enable asynchronous data access, we would need to add “Asynchronous Processing=true;” in the connection string.

The asynchronous access is triggered by the command methods prefixed by “Begin” and the result is retrieved through their “End” counterparts as below:

Synchronous Methods
Asynchronous methods
Start process returns IAsunchResult End process returns data
ExecuteNonQuery BeginExecuteNonQuery EndExecuteNonQuery
ExecuteReader BeginExecuteReader EndExecuteReader
ExecuteXmlReader BeginExecuteXmlReader EndExecuteXmlReader

Each of these asynchronous execution methods return  IAsyncResult. The IAsyncResult allows us to control and read into the asynchronous call with it properties – IsCompleted, AsyncState,  CompletedSynchronously & AsyncWaitHandle. The AsyncWaitHandle property returns the WaitHandle object.

The WaitHandle is an abstract class which provides a handle to the asynchronous execution. It exposed methods such as WaitOne(), WaitAny() and WaitAll() notifying the status of the execution. To process more than one databases commands, we can simply create an array containing wait handles for each process and wait till the WaitAll() or WaitAny() responds.

AsyncCallback is a delegate, used to specify which method to be called once the Asynchronous process is over.

For the next few examples we’ll be using the following modal and it’s constructor. Passing the reader is not the best way to initiate a class in many scenarios but it works for our examples.

public class Customer {

    public Customer() {
    }

    public Customer(SqlDataReader reader) {

        CustomerID = reader["CustomerID"].ToString();
        CompanyName = reader["CompanyName"] == null ? string.Empty : reader["CompanyName"].ToString();
        ContactName = reader["ContactName"] == null ? string.Empty : reader["ContactName"].ToString();
        Phone = reader["Phone"] == null ? string.Empty : reader["Phone"].ToString();
    }

    public string CustomerID { get; set; }
    public string CompanyName { get; set; }
    public string ContactName { get; set; }
    public string Phone { get; set; }

}

The Poll Approach:

In the poll approach, we make a call to the database, executing the required command and keep polling the status or the command to check if the execution is complete. Here’s the method that does just that:

public List<Customer> GetAllCustomers() {

    List<Customer> customers = new List<Customer>();
    IAsyncResult asyncResult = null;;
    SqlDataReader sqlReader = null;

    SqlConnection sqlConnection = new SqlConnection();
    sqlConnection.ConnectionString = ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString;
    SqlCommand sqlCommand = sqlConnection.CreateCommand();
    sqlCommand.CommandText = "SELECT top 10 * FROM [Customers]";
    sqlCommand.CommandType = CommandType.Text;

    try{
        sqlConnection.Open();

        //Start Async process
        asyncResult = sqlCommand.BeginExecuteReader();

        while (!asyncResult.IsCompleted) {
            //Wait till Async process is executing
            Thread.Sleep(10);
        }

        //Retrieve result from the Async process
        sqlReader = sqlCommand.EndExecuteReader(asyncResult);

        while (sqlReader.Read()) {
            customers.Add(new Customer(sqlReader));
        }

        sqlConnection.Close();
    }
    catch(Exception ex){

    }

    return customers;

}

The Wait Approach

Using this approach we can start multiple asynchronous processes and wait till they are complete. The real benefit of  the wait process doesn’t come into the picture unless you have to make multiple database calls in the same or make calls to different databases to get the same entity.

Imagine we need to fetch customers as well as employees using the following employee model

public class Employee {

    public Employee() { }

    public Employee(SqlDataReader reader) {

        EmployeeID = (int)reader["EmployeeID"];
        LastName = reader["LastName"] == null ? string.Empty : reader["LastName"].ToString();
        FirstName = reader["FirstName"] == null ? string.Empty : reader["FirstName"].ToString();
        Title = reader["Title"] == null ? string.Empty : reader["Title"].ToString();

    }

    public int EmployeeID { get; set; }
    public string LastName { get; set; }
    public string FirstName { get; set; }
    public string Title { get; set; }
}

In order to enable the connection to support multiple result sets, as in this case, we would need to set the MultipleActiveResultSets property of the connection string to true. To do that add “MultipleActiveResultSets = true;” in the connection string.

After those setting taken care of, we fire multiple commands using the wait approach:

List<Customer> customers = new List<Customer>();
    List<Employee> employees = new List<Employee>();

    SqlDataReader customerSqlReader = null;
    SqlDataReader employeeSqlReader = null;

    IAsyncResult customerAsyncResult = null;
    IAsyncResult employeeAsyncResult = null;
    WaitHandle[] waitHandles = new WaitHandle[2];

    SqlConnection sqlConnection = new SqlConnection();
    sqlConnection.ConnectionString = ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString;

    SqlCommand customerSqlCommand = new SqlCommand();
    customerSqlCommand.Connection = sqlConnection;
    customerSqlCommand.CommandText = "SELECT top 10 * FROM [Customers]";
    customerSqlCommand.CommandType = CommandType.Text;

    SqlCommand employeeSqlCommand = new SqlCommand();
    employeeSqlCommand.Connection = sqlConnection;
    employeeSqlCommand.CommandText = "SELECT top 10 * FROM [Employees]";
    employeeSqlCommand.CommandType = CommandType.Text;

    try{
        sqlConnection.Open();

        //Start Async processes
        customerAsyncResult = customerSqlCommand.BeginExecuteReader();
        employeeAsyncResult = employeeSqlCommand.BeginExecuteReader();
        waitHandles[0] = customerAsyncResult.AsyncWaitHandle;
        waitHandles[1] = employeeAsyncResult.AsyncWaitHandle;

        WaitHandle.WaitAll(waitHandles);

        //Retrieve result from the Async process
        customerSqlReader = customerSqlCommand.EndExecuteReader(customerAsyncResult);
        while (customerSqlReader.Read()) {
            customers.Add(new Customer(customerSqlReader));
        }

        employeeSqlReader = employeeSqlCommand.EndExecuteReader(employeeAsyncResult);
        while (employeeSqlReader.Read()) {
            employees.Add(new Employee(employeeSqlReader));
        }

        sqlConnection.Close();
    }
    catch(Exception ex){

    }

In the above code snippet  we wait for all the database calls to complete before processing it. An improvement that can be made here is processing data as we receive it. To achieve that, we would have to use the WaitAny() instead of the WaitAll() method and running a loop for each execution. Here’s how:

List<Customer> customers = new List<Customer>();
    List<Employee> employees = new List<Employee>();

    SqlDataReader customerSqlReader = null;
    SqlDataReader employeeSqlReader = null;

    IAsyncResult customerAsyncResult = null;
    IAsyncResult employeeAsyncResult = null;
    WaitHandle[] waitHandles = new WaitHandle[2];

    SqlConnection sqlConnection = new SqlConnection();
    sqlConnection.ConnectionString = ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString;

    SqlCommand customerSqlCommand = new SqlCommand();
    customerSqlCommand.Connection = sqlConnection;
    customerSqlCommand.CommandText = "SELECT top 10 * FROM [Customers]";
    customerSqlCommand.CommandType = CommandType.Text;

    SqlCommand employeeSqlCommand = new SqlCommand();
    employeeSqlCommand.Connection = sqlConnection;
    employeeSqlCommand.CommandText = "SELECT top 10 * FROM [Employees]";
    employeeSqlCommand.CommandType = CommandType.Text;

    try{
        sqlConnection.Open();

        //Start Async processes
        customerAsyncResult = customerSqlCommand.BeginExecuteReader();
        employeeAsyncResult = employeeSqlCommand.BeginExecuteReader();
        waitHandles[0] = customerAsyncResult.AsyncWaitHandle;
        waitHandles[1] = employeeAsyncResult.AsyncWaitHandle;

        for (int i = 0; i < 2; i++) {

            int waitHandleIndex = WaitHandle.WaitAny(waitHandles);

            switch (waitHandleIndex) {

                case 0:
                    customerSqlReader = customerSqlCommand.EndExecuteReader(customerAsyncResult);

                    while (customerSqlReader.Read()) {
                        customers.Add(new Customer(customerSqlReader));
                    }

                    break;

                case 1:
                    employeeSqlReader = employeeSqlCommand.EndExecuteReader(employeeAsyncResult);

                    while (employeeSqlReader.Read()) {
                        employees.Add(new Employee(employeeSqlReader));
                    }

                    break;
            }
        }

        sqlConnection.Close();
    }
    catch(Exception ex){

    }

The Callback approach:

This wait approach it great will give the best solution in all the practical scenarios that you will come across.  Please refer to the next blog post for the callback approach.

Batch Updates in ADO.NET 2.0 for Improved Performance

When you updated a database using the DataAdapter in .NET 1.1 each command was sent to the database one at a time.  This caused a lot of roundtrips to the database.

ADO.NET 2.0 has introduced the concept of Batch Updates, which allows you to designate the number of commands sent to the database at a given time.  If used correctly, this can increase the performance of your data access layer by reducing the number of roundtrips to the database.

DataAdapter.UpdateBatchSize Property

The DataAdapter has an UpdateBatchSize Property that allows you to set the number of commands that will be sent to the database with each request.

  • UpdateBatchSize = 1, disables batch updates
  • UpdateBatchSize = X where X > 1, sends x statements to the database at a time
  • UpdateBatchSize = 0, sends the maximum number of statements at a time allowed by the server

Command.UpdatedRowSource Property

When using batch mode, the UpdatedRowSource property of the command can only be set to either UpdatedRowSource.None or UpdatedRowSource.OutputParameters

Continue reading “Batch Updates in ADO.NET 2.0 for Improved Performance” »

Top 10 SQL Performance Tips

Specific Query Performance Tips (see also database design tips for tips on indexes):

  1. Use EXPLAIN to profile the query execution plan
  2. Use Slow Query Log (always have it on!)
  3. Don’t use DISTINCT when you have or could use GROUP BY
  4. Insert performance
    1. Batch INSERT and REPLACE
    2. Use LOAD DATA instead of INSERT
  5. LIMIT m,n may not be as fast as it sounds. Learn how to improve it (if possible): http://www.facebook.com/note.php?note_id=206034210932
  6. Don’t use ORDER BY RAND() if you have > ~2K records
  7. Use SQL_NO_CACHE when you are SELECTing frequently updated data or large sets of data
  8. Avoid wildcards at the start of LIKE queries
  9. Avoid correlated subqueries and in select and where clause (try to avoid in)
  10. No calculated comparisons — isolate indexed columns
  11. ORDER BY and LIMIT work best with equalities and covered indexes
  12. Separate text/blobs from metadata, don’t put text/blobs in results if you don’t need them
  13. Derived tables (subqueries in the FROM clause) can be useful for retrieving BLOBs without sorting them. (Self-join can speed up a query if 1st part finds the IDs and uses then to fetch the rest)
  14. ALTER TABLE…ORDER BY can take data sorted chronologically and re-order it by a different field — this can make queries on that field run faster (maybe this goes in indexing?)
  15. Know when to split a complex query and join smaller ones
  16. Delete small amounts at a time if you can
  17. Make similar queries consistent so cache is used
  18. Have good SQL query standards
  19. Don’t use deprecated features
  20. Turning OR on multiple index fields (<5.0) into UNION may speed things up (with LIMIT), after 5.0 the index_merge should pick stuff up.
  21. Don’t use COUNT * on Innodb tables for every search, do it a few times and/or summary tables, or if you need it for the total # of rows, use SQL_CALC_FOUND_ROWS and SELECT FOUND_ROWS()
  22. Use INSERT … ON DUPLICATE KEY update (INSERT IGNORE) to avoid having to SELECT
  23. use groupwise maximum instead of subqueries
  24. Avoid using IN(…) when selecting on indexed fields, It will kill the performance of SELECT query.

Scaling Performance Tips:

  1. Use benchmarking
  2. isolate workloads don’t let administrative work interfere with customer performance. (ie backups)
  3. Debugging sucks, testing rocks!
  4. As your data grows, indexing may change (cardinality and selectivity change). Structuring may want to change. Make your schema as modular as your code. Make your code able to scale. Plan and embrace change, and get developers to do the same.

Network Performance Tips:

  1. Minimize traffic by fetching only what you need.
    1. Paging/chunked data retrieval to limit
    2. Don’t use SELECT *
    3. Be wary of lots of small quick queries if a longer query can be more efficient
  2. Use multi_query if appropriate to reduce round-trips
  3. Use stored procedures to avoid bandwidth wastage

OS Performance Tips:

  1. Use proper data partitions
    1. For Cluster. Start thinking about Cluster *before* you need them
  2. Keep the database host as clean as possible. Do you really need a windowing system on that server?
  3. Utilize the strengths of the OS
  4. pare down cron scripts
  5. create a test environment
  6. source control schema and config files
  7. for LVM innodb backups, restore to a different instance of MySQL so Innodb can roll forward
  8. partition appropriately
  9. partition your database when you have real data — do not assume you know your dataset until you have real data

MySQL Server Overall Tips:

  1. innodb_flush_commit=0 can help slave lag
  2. Optimize for data types, use consistent data types. Use PROCEDURE ANALYSE() to help determine the smallest data type for your needs.
  3. use optimistic locking, not pessimistic locking. try to use shared lock, not exclusive lock. share mode vs. FOR UPDATE
  4. if you can, compress text/blobs
  5. compress static data
  6. don’t back up static data as often
  7. enable and increase the query and buffer caches if appropriate
  8. config params – http://docs.cellblue.nl/2007/03/17/easy-mysql-performance-tweaks/ is a good reference
  9. Config variables & tips:
    1. use one of the supplied config files
    2. key_buffer, unix cache (leave some RAM free), per-connection variables, innodb memory variables
    3. be aware of global vs. per-connection variables
    4. check SHOW STATUS and SHOW VARIABLES (GLOBAL|SESSION in 5.0 and up)
    5. be aware of swapping esp. with Linux, “swappiness” (bypass OS filecache for innodb data files, innodb_flush_method=O_DIRECT if possible (this is also OS specific))
    6. defragment tables, rebuild indexes, do table maintenance
    7. If you use innodb_flush_txn_commit=1, use a battery-backed hardware cache write controller
    8. more RAM is good so faster disk speed
    9. use 64-bit architectures
  10. –skip-name-resolve
  11. increase myisam_sort_buffer_size to optimize large inserts (this is a per-connection variable)
  12. look up memory tuning parameter for on-insert caching
  13. increase temp table size in a data warehousing environment (default is 32Mb) so it doesn’t write to disk (also constrained by max_heap_table_size, default 16Mb)
  14. Run in SQL_MODE=STRICT to help identify warnings
  15. /tmp dir on battery-backed write cache
  16. consider battery-backed RAM for innodb logfiles
  17. use –safe-updates for client
  18. Redundant data is redundant

Storage Engine Performance Tips:

  1. InnoDB ALWAYS keeps the primary key as part of each index, so do not make the primary key very large
  2. Utilize different storage engines on master/slave ie, if you need fulltext indexing on a table.
  3. BLACKHOLE engine and replication is much faster than FEDERATED tables for things like logs.
  4. Know your storage engines and what performs best for your needs, know that different ones exist.
    1. ie, use MERGE tables ARCHIVE tables for logs
    2. Archive old data — don’t be a pack-rat! 2 common engines for this are ARCHIVE tables and MERGE tables
  5. use row-level instead of table-level locking for OLTP workloads
  6. try out a few schemas and storage engines in your test environment before picking one.

Database Design Performance Tips:

  1. Design sane query schemas. don’t be afraid of table joins, often they are faster than denormalization
  2. Don’t use boolean flags
  3. Use Indexes
  4. Don’t Index Everything
  5. Do not duplicate indexes
  6. Do not use large columns in indexes if the ratio of SELECTs:INSERTs is low.
  7. be careful of redundant columns in an index or across indexes
  8. Use a clever key and ORDER BY instead of MAX
  9. Normalize first, and denormalize where appropriate.
  10. Databases are not spreadsheets, even though Access really really looks like one. Then again, Access isn’t a real database
  11. use INET_ATON and INET_NTOA for IP addresses, not char or varchar
  12. make it a habit to REVERSE() email addresses, so you can easily search domains (this will help avoid wildcards at the start of LIKE queries if you want to find everyone whose e-mail is in a certain domain)
  13. A NULL data type can take more room to store than NOT NULL
  14. Choose appropriate character sets & collations — UTF16 will store each character in 2 bytes, whether it needs it or not, latin1 is faster than UTF8.
  15. Use Triggers wisely
  16. use min_rows and max_rows to specify approximate data size so space can be pre-allocated and reference points can be calculated.
  17. Use HASH indexing for indexing across columns with similar data prefixes
  18. Use myisam_pack_keys for int data
  19. be able to change your schema without ruining functionality of your code
  20. segregate tables/databases that benefit from different configuration variables

Other:

  1. Hire a MySQL ™ Certified DBA
  2. Know that there are many consulting companies out there that can help, as well as MySQL’s Professional Services.
  3. Read and post to MySQL Planet at http://www.planetmysql.org
  4. Attend the yearly MySQL Conference and Expo or other conferences with MySQL tracks (link to the conference here)
  5. Support your local User Group (link to forge page w/user groups here)

Source : http://forge.mysql.com/wiki/Top10SQLPerformanceTips

Powered by WordPress | Theme: by 85ideas. Editor by Khoanguyen