Re: Insert speed (JDBC and MySQL)



John wrote:
> Hi,
>
> I am writing a program that needs to typically carry out around 100,000
> INSERTs to a mysql database. I would normally load the data using a text
> file, but in this case, there is the occasional query required (evenly
> spread through, and dependent on, the INSERTs).
>
> I had the program connecting to a remote database and was achieving
> around 47ms per INSERT. I thought that connecting to the database
> locally would improve the speed, but it is unchanged at around 47ms.
>
> This compares (very) unfavourably with the 0.3 ms that can be achieved
> by piping a text file of sql into the command line tool.
>
> Does anyone know how to improve the performance of these INSERTs?
>
> Similarly, what speeds can be achieved for INSERTS using JDBC? (using
> one sensible machine only).
>
> Thanks,
>
> John

John,

How are your inserts crafted? Without knowing that, you're comparing
apples and oranges.

I can load 100 thousand rows using JDBC in just under a second over
100mbit ethernet via batched inserts (i.e. of the form INSERT INTO foo
VALUES (...), (...), (...)), so you've definitely got something not
efficient with the way you're doing it.

-Mark
.



Relevant Pages

  • Re: Permission to open database
    ... John I got it to work with the code below I got from an example I found. ... Dim rst As DAO.Recordset ... "Please contact the Database Adminstrator for assistance.", ... "WelcomeForm" ...
    (microsoft.public.access.gettingstarted)
  • Re: Exporting Info To Word File
    ... degree of automation) to get individual records from an existing databse when ... need from my database. ... "John Nurick" wrote: ... >>> document from the template, and place the information in the bookmarks ...
    (microsoft.public.access.externaldata)
  • Re: Communication Log
    ... "John Marshall, MVP" wrote: ... Visio MVP ... May I send you copy of the database that I made? ... a communication log in the database so that it will store the Date, ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Export Project notes to Access or Excel
    ... John: I have the same problem as the OP. ... Unfortunately SQL Reporting Services does not have a text field that will ... The macro couldn't get past the 'Dim cn ... Actually you CAN use the code you found in the Project database ...
    (microsoft.public.project)
  • Re: Need some help with MOVENEXT/MOVEPREVIOUS
    ... John wrote: ... Your database has only one record with '123' in MYFIELD ... That's why opening the database then opening a recordset query works. ... Doing the select and the routine, the table is filled with the requested record. ...
    (microsoft.public.vb.database.dao)