Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: specify hash or merge join in EXPLAIN #35688

Merged
merged 1 commit into from
Mar 14, 2019

Conversation

RaduBerinde
Copy link
Member

Replace join with hash-join or merge-join in EXPLAIN output.

Fixes #35683.

Release note (sql change): EXPLAIN tree now uses hash-join or
merge-join instead of join.

@RaduBerinde RaduBerinde requested review from knz, awoods187 and a team March 13, 2019 14:58
@RaduBerinde RaduBerinde requested a review from a team as a code owner March 13, 2019 14:58
@RaduBerinde RaduBerinde requested review from a team March 13, 2019 14:58
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@rytaft rytaft left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 27 of 27 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @awoods187, @jordanlewis, @knz, and @RaduBerinde)


pkg/sql/walk.go, line 659 at r1 (raw file):

			return "merge-join"
		}
		return "hash-join"

Is lookup join taken care of elsewhere?

Copy link
Member Author

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @awoods187, @jordanlewis, @knz, and @rytaft)


pkg/sql/walk.go, line 659 at r1 (raw file):

Previously, rytaft wrote…

Is lookup join taken care of elsewhere?

Yes, that's a lookupJoinNode and it's already printed as lookup-join.

Copy link
Member Author

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

@knz No need to review but let me know if you're ok with this change to replace join to hash-join or merge-join in EXPLAIN output.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @awoods187, @jordanlewis, @knz, and @rytaft)

Copy link
Collaborator

@rytaft rytaft left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @awoods187, @jordanlewis, and @knz)


pkg/sql/walk.go, line 659 at r1 (raw file):

Previously, RaduBerinde wrote…

Yes, that's a lookupJoinNode and it's already printed as lookup-join.

👍

Replace `join` with `hash-join` or `merge-join` in `EXPLAIN` output.

Fixes cockroachdb#35683.

Release note (sql change): EXPLAIN tree now uses `hash-join` or
`merge-join` instead of `join`.
Copy link
Member

@jordanlewis jordanlewis left a comment

Choose a reason for hiding this comment

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

:lgtm: good idea!

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @awoods187, @jordanlewis, @knz, and @rytaft)

@RaduBerinde
Copy link
Member Author

bors r+

craig bot pushed a commit that referenced this pull request Mar 14, 2019
35688: sql: specify hash or merge join in EXPLAIN r=RaduBerinde a=RaduBerinde

Replace `join` with `hash-join` or `merge-join` in `EXPLAIN` output.

Fixes #35683.

Release note (sql change): EXPLAIN tree now uses `hash-join` or
`merge-join` instead of `join`.

35719: roachpb: prevent data race on Transaction r=nvanbenschoten a=nvanbenschoten

Fixes #34241.

This PR starts off with a series of small cleanups related to ownership of `roachpb.Transaction` objects and the use of deep and shallow clones. This makes up the first 5 commits.

Next, the 6th commit removes redundant calls to `Transaction.UpdateObservedTimestamp`, reducing it down to have just a single caller that is easy to reason about.

The 7th commit is what actually fixes the referenced issue. It adds in the proto clone that was missing from `BatchResponse_Header.combine` and allowing a `BatchRequest` to reference the same `Transaction` object as a `BatchResponse`. I confirmed a number of times that this stops the assertion from firing, so the commit also re-enables the skipped roachtest and removes the assertion.

~The final two commits are the two that we might consider waiting on and not including in this release, but they're also the most exciting. By making `Transaction.ObservedTimestamps` immutable (which it almost already was), we can prohibit all interior mutability of references within `Transaction`, give it value semantics, and eliminate the distinction between "shallow" and "deep" object cloning. This reduces the cost of a clone to a single straightforward allocation and makes working with the object easier to think about.~

EDIT: these two were removed from this PR.

Past this point, I think the only other change we might want to make here is making a clone of `ba.Txn` in `internalClientAdapter` and then declare that the `Batch` handler goroutine has exclusive ownership over its `ba.Txn`. This would allow us to avoid a few conservative clones that would no longer be necessary, like [here](https://github.com/cockroachdb/cockroach/blob/57e825a7940495b67e0cc7213a5fabc24e12be0e/pkg/storage/store.go#L2827) and [here](https://github.com/cockroachdb/cockroach/blob/57e825a7940495b67e0cc7213a5fabc24e12be0e/pkg/storage/replica.go#L1309). I did not make this change here.

35736: opt: catch all pgerror.Error in optbuilder r=RaduBerinde a=RaduBerinde

We now catch all `pgerror.Error`s in optbuilder, which means that we
don't need to use the `buildError` wrapper with them. The wrapper
still exists when external calls (e.g. for name resolution) return a
generic error.

The main motivation is that optbuilder calls into the factory which
can panic internally. We will want to switch those panics to assertion
errors as well, but they are in different packages. The existing
approach would have required a shared, exported wrapper.

Release note: None

Co-authored-by: Radu Berinde <[email protected]>
Co-authored-by: Nathan VanBenschoten <[email protected]>
@craig
Copy link
Contributor

craig bot commented Mar 14, 2019

Build succeeded

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