@@ -242,6 +242,18 @@ bool flex_table_t::has_columns_with_expire() const noexcept
242242 [](auto const &column) { return column.has_expire (); });
243243}
244244
245+ void flex_table_t::prepare (pg_conn_t const &db_connection) const
246+ {
247+ if (has_id_column () && has_columns_with_expire ()) {
248+ db_connection.exec (build_sql_prepare_get_wkb ());
249+ }
250+ }
251+
252+ void flex_table_t::analyze (pg_conn_t const &db_connection) const
253+ {
254+ analyze_table (db_connection, schema (), name ());
255+ }
256+
245257static void enable_check_trigger (pg_conn_t const &db_connection,
246258 flex_table_t const &table)
247259{
@@ -285,7 +297,7 @@ void table_connection_t::start(pg_conn_t const &db_connection, bool append)
285297 enable_check_trigger (db_connection, table ());
286298 }
287299
288- prepare (db_connection);
300+ table (). prepare (db_connection);
289301}
290302
291303void table_connection_t::stop (pg_conn_t const &db_connection, bool updateable,
@@ -368,19 +380,7 @@ void table_connection_t::stop(pg_conn_t const &db_connection, bool updateable,
368380 }
369381
370382 log_info (" Analyzing table '{}'..." , table ().name ());
371- analyze (db_connection);
372- }
373-
374- void table_connection_t::prepare (pg_conn_t const &db_connection)
375- {
376- if (table ().has_id_column () && table ().has_columns_with_expire ()) {
377- db_connection.exec (table ().build_sql_prepare_get_wkb ());
378- }
379- }
380-
381- void table_connection_t::analyze (pg_conn_t const &db_connection)
382- {
383- analyze_table (db_connection, table ().schema (), table ().name ());
383+ table ().analyze (db_connection);
384384}
385385
386386void table_connection_t::create_id_index (pg_conn_t const &db_connection)
0 commit comments