builtins: implement *_description with UDFs#95090
Merged
rafiss merged 1 commit intocockroachdb:masterfrom Jan 11, 2023
Merged
Conversation
Member
081173d to
100f31f
Compare
jordanlewis
reviewed
Jan 11, 2023
pkg/sql/sem/builtins/pg_builtins.go
Outdated
| WHERE objoid = $1 | ||
| AND objsubid = 0 | ||
| AND classoid = CASE $2 | ||
| WHEN 'pg_class' THEN %[1]d |
Member
There was a problem hiding this comment.
I think we should do this using a join on pg_class rather than a hardcoded case/when list, unless there's a strong reason to do it this way? I guess it's maybe more efficient to do it this way - but will there be any compat issues with this?
Collaborator
Author
There was a problem hiding this comment.
what did you have in mind? do you mean AND classoid = $2::regclass::oid? i think that will have a performance penalty, but i'll check.
Member
There was a problem hiding this comment.
Here's how I prototyped it. It definitely might be slower.
Collaborator
Author
There was a problem hiding this comment.
the roundtrips were not affected by the JOIN approach, nor was the latency in my local manual testing, so i'll do it that way
jordanlewis
approved these changes
Jan 11, 2023
57aed38 to
9d12964
Compare
These builtin functions can be implemented using UDFs, which avoids using the internal executor, and dramatically improves the amount of duplicated work. The new benchmarks have fewer roundtrips and no longer scale based on entity count: - django_table_introspection_1_table: 8 -> 5 - django_table_introspection_8_tables: 15 -> 5 Release note: None
9d12964 to
b12398a
Compare
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.
fixes #95068
fixes #87947
These builtin functions can be implemented using UDFs, which avoids using the internal executor, and improves the amount of duplicated work.
The new benchmarks have fewer roundtrips and no longer scale based on entity count:
Release note: None