Repository navigation
Conversation
… exact count The progress total took a COUNT(*) of every table before the first row, a full scan on PostgreSQL and InnoDB. It now comes from the catalog estimate, read once per schema where the driver has a schema-wide read, capped by a row limit and left unset under a filter or when a table has no estimate.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
COUNT(*)of every table before it reads a row. On PostgreSQL and InnoDB that count is a full scan, so the first exported byte waited on a second read of every table.fetchAllTableMetadata) where the driver has one and the export holds two or more tables of that schema, else the per-tablefetchApproximateRowCount. The total is marked as an estimate.ExportServiceRowCountTests(rewritten for the estimate),ExportServiceStopTests(a Stop during the estimate read), andReadOnlySafeModeEntryPointTests(an export at Read-Only runs no count).Measured
PostgreSQL 17.12 in Docker on this Mac, server time:
pg_class.reltuples)The before interval grows with table size; the after one does not. The 1,000-table read is the schema-wide metadata read, which also reads relation sizes.
Test plan
ExportServiceRowCountTests: noCOUNT(statement for a table export, total is the estimate, a limit of 1,000 on a 10M estimate totals 1,000, a filter leaves no total, a missing estimate leaves no total, two tables of one schema take the schema-wide read once, estimates saturate atInt.max.ExportServiceStopTests,ReadOnlySafeModeEntryPointTests,ExportServiceRedisTests,ExportServiceDataSourceTests,TransferProgressTests,ExportServiceTimeoutTests.Closes #4552