[yunqa.de] Re: speed with 15k tables?

  • From: Delphi Inspiration <delphi@xxxxxxxx>
  • To: yunqa@xxxxxxxxxxxxx
  • Date: Sun, 14 Apr 2013 13:16:06 +0200

On 13.04.2013 16:03, Vladimir Viskovic wrote:

> I have database <300mb with around 15000 tables, each table containing
> 15 columns and approx 400-800 rows

SQLite3 does not set a strict limit on the number of tables in a
database file, the max number of rows in a table is 2E64.

However, there are practical limits to the number of tables and rows.
While SQLite3 can handle 15000 tables with 800 rows each, it is not well
optimized for such large numbers. The performance delay you are
experiencing is expected.

> When trying to open database for the first time and passing what table
> (i know exactly what table name,no need to search) to open via stmt
> Dbase prepare, need to wait around 20-30  sec to locate  table
> (every next time, takes 2-3 sec)

Advice is to change your database design:

1) Instead of thousands of tables with the same schema, it is usually
better to use just one table with an extra column to mark what kind of
data each record is.

2) Split data into multiple database files with fewer tables.

Ralf
_______________________________________________
Delphi Inspiration mailing list
yunqa@xxxxxxxxxxxxx
//www.freelists.org/list/yunqa



Other related posts: