Hi,
I changed a few columns, bidsize and asksize are integer now, and i changed ticknumber to smallint unsigned.
At first I used the ticknumbers by the feedserver, now I count up to 65,000 and then reset the counter back to 0. I need that additional column to handle multiple ticks within one second.
now I have a row_length of 41 instead of 61 on the "geldbrief"-table, but there is still just way to much memory-usage
quelle is the stock-exchange ("source");
So normally a contract is traded on a principal exchange, not two, I would eventually suggest doing that :
CREATE TABLE instrument (
id integer NOT NULL auto_increment,
symbol varchar(12) NOT NULL default '',
quelle int(10) NOT NULL default 0,
PRIMARY KEY(id)
);
that would save you around 9 bytes per records. (13 - foreign key)
since normally stock are quoted in integer, you could event with a multiplier go for an integer instead of double in your bid/ask, that would save you 4 extra bytes (that's what we do on our side).
By using an extra table 'instrument', your primary key will be really smaller and you would be able to use less memory.
(try primary key(instrument_id,kurszeit), droping event the ticknumber, it will drop dramatically the memory usage for the index).
I don't think that the disc-based table engines can respond quick enough and handle all the inserts at the same time... but I might give it a try next week.
or one table per symbol maybe ?
-- Philippe Poelvoorde COS Trading Ltd.
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]