On 4/03/2009 5:52 AM, Trainor, Chris wrote: > I am trying to use the Sum function on a column in a table with ~450K > rows in it. > > Select sum(Col4) from Table1 > > Where Table1 looks like this: > > Create TABLE Table1 ( > Col1 INTEGER NOT NULL, > Col2 INTEGER NOT NULL, > Col3 INTEGER NOT NULL, > Col4 BIGINT NOT NULL, > Col5 BIGINT NOT NULL, > Col6 BLOB NOT NULL,
What is the min/max/average size of this blob and how often do you need to access it? If the answer tends towards "huge and rarely", consider putting it in a separate table. > Col7 CHAR(1) DEFAULT '0', > Col8 NUMERIC(2) NOT NULL, > Col9 NUMERIC(2) NOT NULL, > Col10 INTEGER NOT NULL, > Col11 INTEGER NOT NULL, > CONSTRAINT FK_1 FOREIGN KEY (Col1) REFERENCES Table2 (Col1) > ON DELETE CASCADE > ON UPDATE CASCADE, > CONSTRAINT PK_1 PRIMARY KEY (Col10, Col11, Col1, Col3 DESC) > ); _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users