Repository navigation
perf(export): read a PostgreSQL dump's index, comment, sequence and enum DDL once per schema - #4355
Merged
Merged
Conversation
…s per table in schema reads
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
pg_sequencesexists: before it each last value is a statement of its own.PluginExportBulkReadsgainsindexDDL,commentDDL,dependentSequencesanddependentTypes.PluginDatabaseDriverandPluginExportDataSourcegainfetchAllIndexDDL,fetchAllCommentDDL,fetchAllDependentSequencesandfetchAllDependentTypes, default empty.ExportDataSourceAdapterandMaskingExportDataSourceforward them.CREATE TYPE, in the SQL export and the DDL tab, and the restore failed onpg_enum_typid_label_index. The enum read now aggregates each type once.CREATE TABLEcarries indexes and comments), so they declare nothing.apple/scripts/probes/check-postgres-dump-schema-reads.sh: dumps a fixture reading per table and per schema, diffs the files and restores the enum case.Test plan
SQLExportGroupReadTests: one read per kind per group and the same dump as table reads, fallback after a failed group read with the failing table still named, a lone object read alone, a read at the row limit set aside, Unicode forms of a relation and of a schema kept apart, cancellation rethrown.PostgreSQLExportSchemaReadTests: each schema statement is the per-table one minus the relname test, each bulk answer equals the per-table decode, pre-10 servers keep sequences per table, a read at the row ceiling or holding two Unicode forms of a name throws.PostgreSQLCatalogExportTests(enum aggregated once per type),ExportDataSourceAdapterCatalogTestsandMaskingExportTests(the four reads forwarded). The bulk statements joinPostgreSQLCatalogQualificationTestsandPostgreSQLLegacyCatalogQueryTests.INCLUDE, partitioned and materialized view indexes, comments on tables, columns, views and materialized views, owned and free sequences (one shared by two tables), quoted names, enum types, NFC and NFD names, 50 plain tables. Byte-identical apart from theGenerated:line. The two-columns-of-one-enum dump differs only in itsCREATE TYPEline, and now restores.CREATE TABLEread and the rows.