On 10 Oct 2016, at 4:52am, sanhua.zh <sanhua...@foxmail.com> wrote:

> I foundCREATE TABLE/ALTER TABLE Slow Down When Table Count Grow.

Yes.  SQLite needs to search through the (hashed) list of tables every time you 
give it a command that uses tables.  The more tables there are, the longer it 
has to search -- each time it gets a command.  The more tables there are, the 
more indexes there are, and the longer SQLite has to spend searching through 
the indexes too.  The more tables there are, the more space is wasted on space 
allocated to each of these tables and indexes which goes unused.

Are you creating new tables inside your application ?  Do these new tables have 
the same columns as one-another (or nearly the same columns) ?

If so, then it is far more efficient to create one table with one extra column 
for what used to be the tablename.  SQLite can easily handle a table with 
billions of rows and it will far faster to do that than searching through ten 
thousand tables.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to