Take the 2-minute tour ×

I have a table like this :

create table stream_last
        symbol_id       integer,
        high            decimal(8,2),
        low             decimal(8,2),
        last            decimal(8,2),
        volume          integer,
        last_updated    datetime,
        INDEX USING BTREE(symbol_id)

I need to do about 4,000 inserts every 5 seconds (blasted in by a C program reading a stream and aggregating on symbol_id). However, I could sort the data first and insert in order by symbol_id ASCENDING. would that make this bulk insert faster?

a secondary question would be, is BTREE the best option here for index? From the documentation, I could have used HASH but wasn't sure which would be best...


share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Don't think you may gain any significant difference with the optimisation you've proposed, but advises listed here


may certainly help you understand better your needs.

This quote may have sense


You can use the following methods to speed up inserts:


share|improve this answer
wow no kidding. thx for info. I was unaware of this : INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9); –  Don Wool Apr 19 '12 at 0:42
add comment

Your Answer


