diff --git a/student-tests/test_track2.py b/student-tests/test_track2.py index 0ec6d446..06cc28ea 100644 --- a/student-tests/test_track2.py +++ b/student-tests/test_track2.py @@ -146,7 +146,7 @@ def _format_section(title: str, chat_size: int, plan: str, note: str = "") -> st return head + "```\n" + plan.rstrip() + "\n```\n" -def step_explain(dsn: str): +def step_explain(dsn: str, total_messages: int): print("=== 2. EXPLAIN 3 варианта ===") big, small = _big_and_small(dsn) big_size = _chat_size(dsn, big) @@ -175,10 +175,10 @@ def step_explain(dsn: str): parts = [] parts.append( "# Трек 2. EXPLAIN (ANALYZE, BUFFERS): 3 варианта индекса\n\n" - "Данные: 160 001 сообщение, неравномерные чаты. " + "Данные: %d сообщений, неравномерные чаты. " "Запрос: `SELECT ... FROM messages WHERE chat_id = AND (created_at, id) > (<середина>, …) " "ORDER BY created_at, id LIMIT 51`.\n" - "Большой чат ~%d, маленький чат ~%d.\n" % (big_size, small_size) + "Большой чат ~%d, маленький чат ~%d.\n" % (total_messages, big_size, small_size) ) parts.append(_format_section( @@ -453,8 +453,8 @@ def step_rpo(dsn: str, base_url: str, ca_file): def main(): args = arguments("Track 2: plan, write cost, backup/restore, RPO") dsn = _read_dsn() - step_seed(dsn) - step_explain(dsn) + total = step_seed(dsn) + step_explain(dsn, total) step_write_cost(dsn) step_backup_restore(dsn) step_rpo(dsn, args.base_url, args.ca_file)