Repository navigation
perf(connections): read the catalog side kinds in one round trip per engine - #4576
Merged
Merged
Conversation
…engine The catalog load asks the driver for every side kind in one call on one lease; PluginKit gains fetchCatalogSideObjects with a one-by-one default, and PostgreSQL answers it with one Query. The database list is read beside the load.
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
fetchCatalogSideObjects(_:)with a default that asks each kind in turn, so every plugin keeps working unchanged. Additive; the kit stays at 47, already one past the 46 the newest tag shipped.PluginDriverAdapterbridges it and stamps and sorts each kind exactly as the kind's own fetch does.SET LOCAL search_path(LibPQDriverCore.executeCatalogReads). A statement that fails stops the Query, and the core sends each read it never reached alone, so one refused kind costs the others nothing.Measured from the code path on PostgreSQL: the side kinds go from 5 Queries (schemas, routines, triggers, types, extensions) to 1, so the load after the table list drops from 5 round trips to 1. Signpost timings at +50 ms and +200 ms were not run here. MySQL keeps the one-by-one default for now; its pipelined read is left for a follow-up, noted on the issue.
SchemaLeasingLoadTestspinned one lease per side kind and a column read slipping between two kinds; this PR changes both on purpose, and the updated cases say so.Test plan
CatalogSideObjectsBatchTests(new): a load asks the driver once for every side kind on one lease after the tables, and a kind that fails leaves the others committed. Fails on main.SchemaLeasingLoadTests(updated),SchemaService*Tests,SchemaRefreshServiceTests.verify.sh pluginsandverify.sh abifor the PluginKit addition.Closes #4543