I have not done this, but if you have enough RAM available, you might try putting your primary keys in a table in an in-memory database, and test for existence there. That would allow you to enforce uniqueness while postponing creation of the PK index on the disk table until after the initial population has completed.
The only other way to enforce uniqueness without an index is a hashed table (a feature not available in SQLite). On a table with very many rows, finding the key using a hash can be much quicker than scanning a b-tree for it, and inserts moreover do not slow down as no unique index is being created/reorganized during batch population of the table. Regards Tim Romano On 3/15/2010 10:31 AM, Pavel Ivanov wrote: > <much snipped> > >> Is there any way to have a UNIQUE >> field but disable indexing till the end? >> > How do you expect your uniqueness to be enforced? SQLite does that by > looking into index - if value is there then it is repeated, if value > is not there then it's unique and should be inserted into index for > further check. > > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users