Skip to content

Conversation

@mgree
Copy link
Contributor

@mgree mgree commented May 21, 2025

Pair programmed with @antiguru.

Adds support for:

EXPLAIN ANALYZE 
  (HINTS | 
   ((CPU | MEMORY) [, (CPU | MEMORY)] [WITH SKEW]) 
FOR (INDEX ... | MATERIALIZED VIEW ...) 
[AS SQL]

Generates appropriate queries to mz_introspection views, effectively blessing certain introspection queries.

Motivation

Checklist

  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.

@mgree mgree requested a review from a team as a code owner May 21, 2025 19:33
@mgree mgree requested a review from ParkMyCar May 21, 2025 19:33
@mgree mgree force-pushed the explain-analyze branch 2 times, most recently from caa0dce to 46c1ae7 Compare May 21, 2025 19:50
@mgree mgree requested a review from a team as a code owner May 21, 2025 21:51
@ggevay ggevay self-requested a review May 22, 2025 12:37
@mgree mgree force-pushed the explain-analyze branch from c39b65c to 25b78ad Compare May 23, 2025 20:29
AND mz_now() >= a.end_time
ORDER BY a.id, b.amount DESC, b.bid_time, b.buyer;

CREATE INDEX wins_by_item ON winning_bids (item);
Copy link
Contributor

@kay-kim kay-kim May 30, 2025

Choose a reason for hiding this comment

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

So ... running explain analyze for index works but if I update to create a materialized view and run explain analyze for mat view, I get lagging objects. Using one of the mzbuild from this pr.
Oh, ne'er mind. It came back after 263.03s.

Copy link
Contributor

Choose a reason for hiding this comment

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

Added a patch for some docs tweak. I left the transform-data/optimization page alone for now because that page needs a bit more rewrite.

Copy link
Member

@antiguru antiguru left a comment

Choose a reason for hiding this comment

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

Looks good. One stray edit which we should remove before merging.

Some(ExplainFormat::VerboseText)
}
None => return Err(ParserError::new(self.index, "expected a format")),
None => return Err(ParserError::new(self.index, "exTected a format")),
Copy link
Member

Choose a reason for hiding this comment

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

Stray

@mgree mgree enabled auto-merge (squash) June 4, 2025 15:35
Copy link
Contributor

@kay-kim kay-kim left a comment

Choose a reason for hiding this comment

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

lgtm from docs pov.

@mgree mgree merged commit 190bbce into MaterializeInc:main Jun 4, 2025
86 checks passed
@mgree mgree deleted the explain-analyze branch June 4, 2025 20:36
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.

3 participants