Hi Carlos,
On 29/11/2013 9:33 PM, Carlos Ferreira wrote:
Any of you know how to speed up the creation of empty tables in SQlite?
If I have to create more than 1000 empty tables to initialize my application
document it takes a while..
Is there any workaround?
Workaround:
1. I would probably create the database with all the empty tables once
and store it as a file. Whenever a new one is needed, I'd make a copy
of it and use that. The copy may be a file or a blob in memory within
your program or a blob in a database that you're using for your program,
etc.
This is assuming that the SQLite3 table creation is indeed slow. I have
never tried with 1000 empty tables, so I'm not sure that it is.
2. If it is an option, do a lazy creation of tables - create only the
tables that are needed when they are needed. Frankly, if you often read
and write from the database, this is a bit painful since you have to add
quite a few more checks
As always, some of the other things that can give you a bit more speed:
* Transactions
* The correct kind of journal mode (including moving it to memory)
etc.
Best Regards,
Mohit.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users