From 1720b0586cfe0b4e0b32fd8b3ca5b9ef1799d2bc Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 23 May 2021 00:42:10 +0200 Subject: Database: add a ANALYZE step during proj.db creation This will create the sqlite_stat* table (generally sqlite_stat1). This speeds up a bit the test suite. Runtime of ``make test_cpp_api-check`` goes from the range [14.0 s, 14.6 s] to [13.0s, 13.5s] on my machine. --- src/iso19111/factory.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/iso19111/factory.cpp b/src/iso19111/factory.cpp index 7681a2ec..5eb6d012 100644 --- a/src/iso19111/factory.cpp +++ b/src/iso19111/factory.cpp @@ -819,7 +819,9 @@ std::vector DatabaseContext::Private::getDatabaseStructure() { : "db_0."); const auto sqlBegin("SELECT sql||';' FROM " + dbNamePrefix + "sqlite_master WHERE type = "); - const char *const objectTypes[] = {"'table'", "'view'", "'trigger'"}; + const char *const objectTypes[] = {"'table' AND " + "name NOT LIKE 'sqlite_stat%'", + "'view'", "'trigger'"}; std::vector res; for (const auto &objectType : objectTypes) { const auto sqlRes = run(sqlBegin + objectType); @@ -846,7 +848,8 @@ void DatabaseContext::Private::attachExtraDatabases( assert(sqlite_handle_); auto tables = - run("SELECT name FROM sqlite_master WHERE type IN ('table', 'view')"); + run("SELECT name FROM sqlite_master WHERE type IN ('table', 'view') " + "AND name NOT LIKE 'sqlite_stat%'"); std::map> tableStructure; for (const auto &rowTable : tables) { auto tableName = rowTable[0]; -- cgit v1.2.3