Skip to content

rttanalysis: add benchmark for hasura's introspection query#90780

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
rafiss:hasura-col-description-bench
Oct 27, 2022
Merged

rttanalysis: add benchmark for hasura's introspection query#90780
craig[bot] merged 1 commit intocockroachdb:masterfrom
rafiss:hasura-col-description-bench

Conversation

@rafiss
Copy link
Copy Markdown
Collaborator

@rafiss rafiss commented Oct 27, 2022

informs #88885

This query exposes an issue with how we construct filters for certain types of joins. It can be used to verify future enhancements.

Release note: None

@rafiss rafiss requested review from a team, DrewKimball, ZhouXing19 and ajwerner October 27, 2022 17:02
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@rafiss rafiss force-pushed the hasura-col-description-bench branch from 0f68bfc to 3ea70d7 Compare October 27, 2022 17:06
Copy link
Copy Markdown
Collaborator

@DrewKimball DrewKimball left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: I wasn't aware of this benchmark, nice.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @ajwerner and @ZhouXing19)


LEFT JOIN LATERAL
( SELECT
pg_catalog.col_description("table".oid, "column".attnum) as description
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the fix here is to vectorize this builtin so we can do the fetching in parallel. At least, I think that's the simplest approach. @chengxiong-ruan is working on cleaning up some of the comment access but I don't think it's going to be easy to leverage that to pre-fetch the right comments.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be nice to have some more tests with more tables and more columns so that the growth in terms of round-trips is clear.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is any growth in round-trips based on number of tables

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you prove me wrong? I expect for every column in every table that we'll invoke pg_catalog.col_description which will query system.comments, no?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh to be clear, i made that comment after modifying the benchmark setup and trying it, and observing no change. i can commit that though if it's worthwhile

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I wonder if we have a bug in rttanalysis!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like the apply join trace doesn't propagate correctly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it out and it seems like what's going on is that the trace is so big that it's being truncated 😓

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah darn... well then i will go ahead and merge this for now, and if are able to workaround that truncation in the future we can update the benchmark at that time.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This query exposes an issue with how we construct filters for certain
types of joins. It can be used to verify future enhancements.

Release note: None
@rafiss rafiss force-pushed the hasura-col-description-bench branch from 3ea70d7 to 2193506 Compare October 27, 2022 19:57
@rafiss
Copy link
Copy Markdown
Collaborator Author

rafiss commented Oct 27, 2022

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Oct 27, 2022

Build succeeded:

@ajwerner
Copy link
Copy Markdown
Contributor

ajwerner commented Nov 3, 2022

This test with 8 tables seems to take around 6m in CI. I'm inclined to suggest that we skip it until we optimize it.

@ajwerner
Copy link
Copy Markdown
Contributor

ajwerner commented Nov 3, 2022

Screen Shot 2022-11-02 at 10 21 02 PM

@rafiss
Copy link
Copy Markdown
Collaborator Author

rafiss commented Nov 3, 2022

#91225

@rafiss rafiss deleted the hasura-col-description-bench branch November 3, 2022 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants