Skip to content

Commit 605dc26

Browse files
committed
Run ANALYZE on middle tables only in create mode
Fixes #1556
1 parent 499300c commit 605dc26

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

src/middle-pgsql.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ void middle_pgsql_t::relation_delete(osmid_t osm_id)
563563
void middle_pgsql_t::after_nodes()
564564
{
565565
m_db_copy.sync();
566-
if (m_options->flat_node_file.empty()) {
566+
if (!m_options->append && m_options->flat_node_file.empty()) {
567567
auto const &table = m_tables.nodes();
568568
analyze_table(m_db_connection, table.schema(), table.name());
569569
}
@@ -572,15 +572,19 @@ void middle_pgsql_t::after_nodes()
572572
void middle_pgsql_t::after_ways()
573573
{
574574
m_db_copy.sync();
575-
auto const &table = m_tables.ways();
576-
analyze_table(m_db_connection, table.schema(), table.name());
575+
if (!m_options->append) {
576+
auto const &table = m_tables.ways();
577+
analyze_table(m_db_connection, table.schema(), table.name());
578+
}
577579
}
578580

579581
void middle_pgsql_t::after_relations()
580582
{
581583
m_db_copy.sync();
582-
auto const &table = m_tables.relations();
583-
analyze_table(m_db_connection, table.schema(), table.name());
584+
if (!m_options->append) {
585+
auto const &table = m_tables.relations();
586+
analyze_table(m_db_connection, table.schema(), table.name());
587+
}
584588

585589
// release the copy thread and its database connection
586590
m_copy_thread->finish();

0 commit comments

Comments
 (0)