Heikki Tuuri writes:
> Hi!
>
> I tried a test similar to Peter. There is a table with 3 integer
> columns. There is a primary key on the first column and a non-unique
> key on the second column. I wrote a Perl program which inserts rows
> one at a time, and also selects rows one at a time.
>
> I ran the tests on a Linux 2-CPU Xeon 450 MHz. The times below are wall
> clock times.
>
> The results were:
> MyISAM Innobase
> ------------------------------------------------------------
> 100 000 inserts 40 s. 25 s.
>
> 100 000 selects on
> primary key 58 s. 57 s.
>
> 100 000 selects on
> secondary key 95 s. 68 s.
> ------------------------------------------------------------
>
> It is unusual for a database that a select is slower than an insert. There is
> probably slowness in the communication between the client and the server
> in the select case. Another possible explanation is that query optimization
> takes time in a select. Innobase can do some 100 000 searches per second
> when it calculates a count(*) on a large join. Thus the slowness cannot
> come directly from the access method. It must have something to
> do with query parsing and initialization, or more probably, communication.
>
> Also the Perl code seems to take almost as much CPU as the database server.
> Someone could perhaps measure using the C++ API?
>
> Regards,
>
> Heikki
>
Hi!
The above should be faster with MySQL++, particularly if you use
store() method, like in custom1.cc anad custom3.cc examples from
MySQL++.
Regards,
Sinisa
____ __ _____ _____ ___ == MySQL AB
/*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic
/*/ /*/ /*/ \*\_ |*| |*||*| mailto:[EMAIL PROTECTED]
/*/ /*/ /*/\*\/*/ \*\|*| |*||*| Larnaca, Cyprus
/*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____
^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^
/*/ \*\ Developers Team
---------------------------------------------------------------------
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