Re: MySQL Connector 6.9.6.0 thru 6.5.7.0 is slow.
Roberto,
Here is some simpler code. It runs crazy fast with connector 6.4.6. But when we run it with 6.9.6 or anything older than 6.4.6 it slows down to a crawl.
Dim oStart As Integer = 0
Dim oEnd
cmd.CommandText = "SELECT MAX(payment_no) FROM orderpayment;"
cmd.Connection = connect
Try
connect.Open()
oEnd = cmd.ExecuteScalar
Catch ex As Exception
MsgBox(ex.Message)
End Try
connect.Close()
cmd.Dispose()
Dim oPayment_No As Integer = 0
Dim oCCnum1_Unencrypted As String
Dim oCCnum1_Encrypted As String
Dim oCCnum2_Unencrypted As String
Dim oCCnum2_Encrypted As String
RESTART:
oSelectQuery = "SELECT orderpayment.payment_no, orderpayment.ccnum, orderpayment.ccnum2 " & _
"FROM orderpayment " & _
"WHERE orderpayment.payment_no > " & oPayment_No & _
" LIMIT 50;"
oConnection = New MySqlClient.MySqlConnection(oDatabaseConnection)
oCommand = New MySqlClient.MySqlCommand(oSelectQuery, oConnection)
oConnection.Open()
oReader = oCommand.ExecuteReader(CommandBehavior.CloseConnection)
While oReader.Read()
oPayment_No = Nothing
oCCnum1_Unencrypted = ""
oCCnum2_Unencrypted = ""
oCCnum1_Encrypted = ""
oCCnum2_Encrypted = ""
oPayment_No = oReader.GetString(0)
oCCnum1_Unencrypted = oReader.GetString(1)
oCCnum2_Unencrypted = oReader.GetString(2)
oCCnum1_Encrypted = des.Encrypt(oCCnum1_Unencrypted)
oCCnum2_Encrypted = des.Encrypt(oCCnum2_Unencrypted)
cmd.CommandText = "UPDATE orderpayment " & _
"SET ccnum = '" & oCCnum1_Encrypted & "' " & _
", ccnum2 = '" & oCCnum2_Encrypted & "' " & _
"WHERE payment_no = " & oPayment_No & ";"
cmd.Connection = connect
Try
connect.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
Console.WriteLine(ex.ToString)
End Try
connect.Close()
cmd.Dispose()
oStart = oStart + 1
End While
oReader.Close()
oConnection.Close()
oCommand.Dispose()
oSelectQuery = ""
If oStart >= oEnd Then
'Do Nothing
Else
Console.WriteLine(oStart & " of " & oEnd & " is Completed.")
GoTo RESTART
End If
Subject
Written By
Posted
Re: MySQL Connector 6.9.6.0 thru 6.5.7.0 is slow.
April 09, 2015 03:02PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.