Skip to content

sql: fix the double render optimization for views#17305

Merged
knz merged 1 commit intocockroachdb:masterfrom
knz:20170730-fix-view-dep
Jul 30, 2017
Merged

sql: fix the double render optimization for views#17305
knz merged 1 commit intocockroachdb:masterfrom
knz:20170730-fix-view-dep

Conversation

@knz
Copy link
Copy Markdown
Contributor

@knz knz commented Jul 29, 2017

My previous commit to do that was rather wrong. I have re-written the patch and added an extensive comment to explain what was going on, and a test that checks the descriptor dependencies are properly set up.

@knz knz requested a review from RaduBerinde July 29, 2017 22:57
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@RaduBerinde
Copy link
Copy Markdown
Member

LGTM. The explanation makes sense to me but I'm not very familiar with the implementation around views, maybe @jordanlewis should take a look too


Review status: 0 of 3 files reviewed at latest revision, 2 unresolved discussions, all commit checks successful.


pkg/sql/expand_plan.go, line 341 at r2 (raw file):

		// where can we put this bit?
		//
		// We can only put is somewhere where "there is room". (Ideally,

put it


pkg/sql/expand_plan.go, line 346 at r2 (raw file):

		// the bit from an elided renderNode to its source, whatever its
		// type. But that's not currently possible). We know "there is
		// room" on another renderNode, so if that's what we have a

as a source


Comments from Reviewable

@knz knz force-pushed the 20170730-fix-view-dep branch from ac02d7f to f540c9a Compare July 30, 2017 09:13
@knz
Copy link
Copy Markdown
Contributor Author

knz commented Jul 30, 2017

Okay. Actually in the light of #17306 I am removing the fix / optimization from this PR and only keep the revert. I will merge that to fix the bug that was introduced in master, and I will propose an alternate form of the optimization in my separate PR to fix #17306.

This reverts commit 74c7b0f.

The "optimization" in that commit was simply invalid. The field
`sourceRender.source.info.viewDesc` must not be overwritten if that was
the non-nil field and `r.source.info.viewDesc` was nil.

Will submit the correct optimization in a subsequent commit.
@knz knz force-pushed the 20170730-fix-view-dep branch from f540c9a to d57e9f3 Compare July 30, 2017 09:18
@knz knz merged commit aab1af3 into cockroachdb:master Jul 30, 2017
@knz knz deleted the 20170730-fix-view-dep branch July 30, 2017 09:32
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