Skip to content

Refresh drops a large table's row total #4420

Open

Description

@datlechin

What happened?

On a table larger than the Exact row count setting (100,000 rows by default), Refresh (Cmd+R) removes the row total. Before it the status bar reads 1-1,000 of ~5,000,000 rows; after it the total is gone. To get there the refresh runs a count of up to 100,001 rows.

Steps to reproduce

  1. Open a PostgreSQL or MySQL table with more than 100,000 rows. The status bar shows of ~N rows.
  2. Press Cmd+R.
  3. The total disappears from the status bar.

Expected behavior

Refresh keeps the estimate, or reads a new one the way opening the table does, and runs no 100,001-row count.

Code path

  • reloadTableTab retires the total on every Refresh (apple/TablePro/Views/Main/Extensions/MainContentCoordinator+Refresh.swift:104-105).
  • The reload reuses the cached schema, whose approximateRowCount is nil (apple/TablePro/Core/Services/Query/QueryExecutor.swift:67-82), so no estimate comes back.
  • With no estimate, rowCountPlan picks a count capped at threshold + 1 (apple/TablePro/Core/Coordinators/QueryExecutionCoordinator+Helpers.swift:897-902), and a count that reaches the cap clears the total (:852-860).
  • A save goes the same way (apple/TablePro/Core/Coordinators/RowEditingCoordinator+SaveChanges.swift:424).

Evidence: in the audit's PostgreSQL session the only count after Cmd+R on rt_orders was SELECT COUNT(*) FROM (SELECT 1 AS row_marker FROM "public"."rt_orders" LIMIT 100001 OFFSET 0) capped_rows, with no estimate read. That table has exactly 100,000 rows, so it still showed a total. A larger one hits the cap.

Database type

PostgreSQL (MySQL takes the same path)

TablePro version

main (f67b55a)

Platform

macOS

Found during the 2026-11-22 perf audit.

Activity

  1. added
    bug
    platform-macos
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugplatform-macos

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions