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)
) ENGINE=MEMORY;
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…
Don
Don’t think you may gain any significant difference with the optimisation you’ve proposed, but advises listed here
http://dev.mysql.com/doc/refman/5.0/en/insert-speed.html
may certainly help you understand better your needs.
This quote may have sense