Results 1 to 4 of 4

Thread: Who said MySQL is fast??

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Granby, Qc, Canada
    Posts
    602

    Who said MySQL is fast??

    I created an application to compare Microsoft Access and MySQL.

    Here are my connections string for both:

    For MDB :
    VB Code:
    1. Call m_connMDB.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Data.mdb;Persist Security Info=False")

    For MySQL :
    VB Code:
    1. Call m_connMySQL.Open("DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=Data;USER=root;PASSWORD=grb;OPTION=3;")

    I have 1 table in both DB.

    The table is called "Test" and have 3 integer fields.

    I have a loop that run through all records and add 1 to the value and save it.

    For MDB :
    VB Code:
    1. Set rstMDB = New ADODB.Recordset
    2.  
    3.   Call rstMDB.Open("SELECT * FROM Test", m_connMDB, adOpenDynamic, adLockOptimistic)
    4.  
    5.   Do While Not rstMDB.EOF
    6.     rstMDB.Fields("FIELD1") = rstMDB.Fields("FIELD1") + 1
    7.     rstMDB.Fields("FIELD2") = rstMDB.Fields("FIELD2") + 1
    8.    
    9.     Call rstMDB.Update
    10.    
    11.     Call rstMDB.MoveNext
    12.   Loop
    13.  
    14.   Call rstMDB.Close
    15.   Set rstMDB = Nothing

    For MySQL :
    VB Code:
    1. Set rstMySQL = New ADODB.Recordset
    2.  
    3.   Call rstMySQL.Open("SELECT * FROM Test", m_connMySQL, adOpenDynamic, adLockOptimistic)
    4.  
    5.   Do While Not rstMySQL.EOF
    6.     rstMySQL.Fields("FIELD1") = rstMySQL.Fields("FIELD1") + 1
    7.     rstMySQL.Fields("FIELD2") = rstMySQL.Fields("FIELD2") + 1
    8.    
    9.     Call rstMySQL.Update
    10.    
    11.     Call rstMySQL.MoveNext
    12.   Loop
    13.  
    14.   Call rstMySQL.Close
    15.   Set rstMySQL = Nothing

    The MDB loop takes 3 seconds to execute and the MySQL loop takes 197 seconds to execute.

    Am I doing something wrong?

  2. #2
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Who said MySQL is fast??

    Aren't you really comparing OLEDB and ODBC - very different technologies...

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Granby, Qc, Canada
    Posts
    602

    Re: Who said MySQL is fast??

    What is the OLEDB Connection String for MySQL ?

  4. #4
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Who said MySQL is fast??

    This other thread seems to have posts about OLEDB providers for MySQL...

    Good luck...

    http://www.vbforums.com/showthread.php?t=274868

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width