Home > database >  MFC ADO MySQL driven to insert data, a connection 1 second most insert article how much? I write up
MFC ADO MySQL driven to insert data, a connection 1 second most insert article how much? I write up

Time:09-26

 
//create
HRESULT hRst=m_conn. CreateInstance (" ADODB. Connection ");
DWORD dwErr=GetLastError ();
If (FAILED (hRst))
{
StrErr. The Format (" Connection create err % d \ n ", GetLastError ());
BResult=FALSE;
break;
}
HRst=m_cmd. CreateInstance (mand "ADODB.Com");
If (FAILED (hRst))
{
StrErr="Command create err";
BResult=FALSE;
break;
}
//insert
_RecordsetPtr pRst;
M_cmd - & gt; ActiveConnection=(_ConnectionPtr m_conn);
M_cmd - & gt; CommandType=type;
M_cmd - & gt; CommandText=bstr_t (strSQL);
//m_cmd - & gt; The Parameters - & gt; The Refresh ();
PRst=m_cmd - & gt; Execute (NULL, NULL, adCmdUnknown);


 
//my ini
Innodb_flush_log_at_trx_commit=0


Task management server, 1 thread CPU usage by about 20%, 5 thread (each thread has a separate connection) 100% CPU utilization, disk IO up less than 20%.

CodePudding user response:

This should see the MYSQL server specific configuration, use what storage devices, CPU, memory configuration? Some of the parameters configuration and MYSQL itself,

CodePudding user response:

reference 1st floor ACMAIN_CHM response:
this should see the MYSQL server specific configuration, use what storage devices, CPU, memory configuration? Some parameters configuration and MYSQL itself,


My computer is the CPU i57200 (2.5 GHZx4) 8 gb ramdisk SSD256G,

Insert the rate of about 1000 per second can't satisfy the need of the project,
  • Related