Hi I've been puzzled for some days. I believed I had a hang in my system, but it turns out using the .read <file.sql> is horribly slow. I believed it to be an improper trigger, but removing it doesn't help a bit. 1min36sec to read 1000 lines with 6 simple columns into one table.
I know insert with autocommit was slow, but not that slow. Is this filesystem-io based? it works very hard on the filesystem. I also tried simplifying the primary key, but timing is the same. Memory caching, etc? I can emulate file-inserts faster in a palmpilot simulator. Nice if someone could share some light on this. I'm easily going around this bug with commit, so it is not much of a problem once you know. SQLite 3.3.8 on linux 32bit. % wc -l test_autocommit.sql test_commit.sql 1024 test_autocommit.sql 1026 test_commit.sql 2050 total % time echo ".read test_autocommit.sql" | sqlite3 test.db real 1m36.116s user 0m0.408s sys 0m0.988s % rm -rf test.db If I add Begin transaction and commit it is blasting fast: % time echo ".read test_commit.sql" | sqlite3 test.db real 0m0.309s user 0m0.168s sys 0m0.040s sqlite> .schema CREATE TABLE secanaconfig ( name TEXT not null, value TEXT not null, type TEXT not null, grp TEXT, desc TEXT, updated DATE, PRIMARY KEY (name, type) ); CREATE TABLE subtypes ( type TEXT PRIMARY KEY, desc TEXT ); CREATE TRIGGER fki_secanaconfig before insert on secanaconfig FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'insert into secanaconfig foreign-key type does not exists in subtypes table') WHERE (SELECT type FROM subtypes WHERE type = NEW.type) IS NULL; END; Thanks -- Morten Bjoernsvik, Oslo, Norway _________________________________________________________ Alt i ett. Få Yahoo! Mail med adressekartotek, kalender og notisblokk. http://no.mail.yahoo.com _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users