It hurts if server has millions of tables.

See https://github.com/ClickHouse/ClickHouse/pull/3398
Please add some tests to ensure it won't be broken in future.
{
        auto & create_query = query->as<ASTCreateQuery &>();
        assert(create_query.is_dictionary);
        try
        {
            Poco::File meta_file(metadata_path);
            auto config = getDictionaryConfigurationFromAST(create_query, database.getDatabaseName());
            time_t modification_time = meta_file.getLastModified().epochTime();
            database.attachDictionary(create_query.table, DictionaryAttachInfo{query, config, modification_time});
        }
        catch (Exception & e)
        {
            e.addMessage(
                "Cannot attach dictionary " + backQuote(database.getDatabaseName()) + "." + backQuote(create_query.table)
                + " from metadata file " + metadata_path + " from query " + serializeAST(*query));
            throw;
        }
    }
    void logAboutProgress(Poco::Logger * log, size_t processed, size_t total, AtomicStopwatch & watch)