j.random.programmer wrote:
Hi:

Thought I'd mention this (using the latest dev
J/connect):

A)
DatabaseMetaData.getColumns() does not return the last

4 columns (SCOPE_*) but it should according to the API spec
I'll look into fixing this right away. You should write Sun as well, as their JDBC compliance testsuite doesn't look for this :(

B)
InnoDB, on their benchmark page, say that inserting
100,000 rows into the DB is about 5 seconds.

http://www.innodb.com/bench.html

Can you point out where it says this? When I look at the benchmark page, I see that 100,000 inserts take 25 seconds, which JDBC can pretty much match (read on for more).

Quoted (from the page in question):

InnoDB MyISAM
------------------------------------------------------------
100 000 inserts 25 s. 40 s.

100 000 selects on
primary key 57 s. 58 s.

100 000 selects on
secondary key 68 s. 95 s.
------------------------------------------------------------




I am finding this to be more like 300-400 seconds.
Try this:
I think something is broken with your network, or your machine, read on for more....


CREATE TABLE T1 (A INT NOT NULL AUTO_INCREMENT, B INT, PRIMARY KEY(A))
TYPE=INNODB;

CREATE TABLE T2 (A INT NOT NULL, B INT, PRIMARY KEY(A)) TYPE=INNODB;

Now run the java driver (source shown at the end of
this
message).

This takes a long time. The innodb bench URL mentioned
above uses perl DBI has a test driver, the JDBC *should* be as fast if I am not missing anything (but
it's not). Once it's finally done, if you now say
(from the mysql client):

mysql> insert into T2 select * from T1;
Query OK, 107825 rows affected (5.23 sec)
Records: 107825 Duplicates: 0 Warnings: 0
This isn't the same thing as what your test program is testing. This is optimized by the database, it is not even close to issuing 100,000 queries. It moves some rows from one place to another, and only has to issue _one_ query.

Note, this takes about 5 seconds, which shows that
the slowdown is not at the DB level but at the JDBC
driver level (mysql client even sets auto commit
to true by default, and it still takes 5 seoonds).

So why does the JDBC driver take so long ? I am
accessing the mysql machine over a private 100Mbps
connection so I don't think it's the network either.
I would double-check your network. I just ran your code here on my desktop runnin Linux, which is known not to have the fastest java support, to my test server (100 mbit private network), and it takes 30 seconds,
which is 5 seconds longer than 100,000 inserts using DBI (which is using native code to access the database, btw), but is not long enough for HotSpot to actually optimize the code, either.

I would guess you have I/O problems on one of your machines, or you're dropping a lot of packets somewhere, or you're not using the best JVM for your machine/OS combination.



-Mark

--
For technical support contracts, visit https://order.mysql.com/?ref=mmma

__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mark Matthews <[EMAIL PROTECTED]>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java
/_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA
<___/ www.mysql.com


---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to