Re: getting in trouble with multiple insert...

2003-07-10 Thread Egor Egorov
Michael Schoen [EMAIL PROTECTED] wrote:
 
 i?m actually developing a performance criticial system where I need to
 index a huge amount of protocoll data.
 
 These data are already in a chronological order, so if I push the data
 one by one in the database I will never need an ORDER BY syntax, `cause
 mysql already stores the data the right way. That?s tweaking, isn?t it
 ;)
 
 Unfortunatly I need more than 2000 inserts/sec, so simple inserts are
 just too slow. Therefore I used that WONDERFUL multiple insert statement
 and the speed was no problem any more.
 
 BUT with the multiple insert statment the chronological order will be
 lost and I?ll need the ORDER BY syntax again. And the query-speed goes
 down to not usable ;(
 
 To be honest, I don?t really see a reason WHY the chronological ORDER is
 lost this way, but maybe this problem could also be solved with a simple
 trick g

There is no any internal order in the table. So, if you want to be sure that rows are 
retrieved in the particular order, you should use ORDER BY in your queries.



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: getting in trouble with multiple insert...

2003-07-10 Thread Brent Baisley
I assume you have your ORDER BY field indexed, but your query may not 
permit the index to be used for sorting. If you are selecting most of 
the data set or very large portions of it, you may try using HAVING 
instead of WHERE for you filter. Then the index can be used for the 
sort. MySQL will be forced to scan the whole table, but if you are 
grabbing most of the table anyway, it doesn't matter.
You just want to make sure you have fast disks.

On Thursday, July 10, 2003, at 10:25 AM, Michael Schoen wrote:

BUT with the multiple insert statment the chronological order will be
lost and I´ll need the ORDER BY syntax again. And the query-speed goes
down to not usable ;(
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]