sql: move row allocation inside RowContainer#10534
sql: move row allocation inside RowContainer#10534RaduBerinde merged 4 commits intocockroachdb:masterfrom
Conversation
|
Reviewed 2 of 3 files at r1. pkg/sql/values.go, line 40 at r1 (raw file):
For ease of future understanding, consider adding something about the popped rows being at the back of the RowContainer in the range pkg/sql/values.go, line 269 at r1 (raw file):
The awkwardness of this interface and its related functions always catches me off-guard pkg/sql/values.go, line 289 at r1 (raw file):
You might want to include the motivation for this. Something along the lines of: "this resets the effect that popping values had on the Comments from Reviewable |
|
Yeah this first commit is very good. Thanks for this :) Reviewed 3 of 3 files at r1. Comments from Reviewable |
|
And the 2nd one is very good too. I still see wisdom in splitting commits for different issues though, the overlap here is insufficient to justify grouping them. Reviewed 12 of 12 files at r2. pkg/sql/insert.go, line 296 at r2 (raw file):
pkg/sql/row_container.go, line 99 at r2 (raw file):
Move pkg/sql/row_container.go, line 190 at r2 (raw file):
This comment is redundant with the one in pkg/sql/trace.go, line 54 at r2 (raw file):
This seems like an unrelated bug in the implementation of EXPLAIN(TRACE). I would recommend a separate commit for this. pkg/sql/testdata/explain, line 69 at r2 (raw file):
See my comment above - probably best in separate commit. Comments from Reviewable |
This commit replaces the PseudoPop functionality in RowContainer with a rowsPopped variable in the higher layer (valuesNode). This is cleaner and will allow some changes in RowContainer.
explainTraceNode was exposing incorrect Columns(): they did not include the timestamp column which is used during sorting. This resulted in a RowContainer that was configured with an incorrect number of columns.
f4b3882 to
4d4cbb3
Compare
|
TFTRs, updated! Review status: 0 of 12 files reviewed at latest revision, 8 unresolved discussions, some commit checks pending. pkg/sql/insert.go, line 296 at r2 (raw file):
|
|
Reviewed 3 of 12 files at r3. pkg/sql/row_container.go, line 99 at r2 (raw file):
|
|
Reviewed 9 of 12 files at r3, 1 of 1 files at r4, 2 of 2 files at r5, 9 of 9 files at r6. Comments from Reviewable |
|
Review status: all files reviewed at latest revision, 4 unresolved discussions, some commit checks failed. pkg/sql/row_container.go, line 99 at r2 (raw file):
|
|
Review status: all files reviewed at latest revision, 4 unresolved discussions, some commit checks failed. pkg/sql/row_container.go, line 99 at r2 (raw file):
|
|
Review status: all files reviewed at latest revision, 4 unresolved discussions, some commit checks failed. pkg/sql/row_container.go, line 99 at r2 (raw file):
|
4d4cbb3 to
52b02c8
Compare
The majority of RowContainer.AddRow() callers make copies of the rows; most are unoptimized (one allocation per row). Changing RowContainer to manage row storage internally, instead of using the slices passed by the caller. We allocate rows in chunks, which reduces the allocations as well as the overhead of storing a slice for every row. The callers are simplified.
|
Review status: 11 of 12 files reviewed at latest revision, 4 unresolved discussions, some commit checks pending. pkg/sql/row_container.go, line 99 at r2 (raw file):
|
|
Reviewed 1 of 1 files at r7. pkg/sql/row_container.go, line 99 at r2 (raw file):
|
|
Review status: all files reviewed at latest revision, 5 unresolved discussions, all commit checks successful. pkg/sql/row_container.go, line 185 at r7 (raw file):
|
|
Verified there are no regressions in the basic benchmarks https://gist.github.com/RaduBerinde/099fe880b3c664d4b40bf789b44a7b9d Review status: all files reviewed at latest revision, 5 unresolved discussions, all commit checks successful. Comments from Reviewable |
|
Review status: all files reviewed at latest revision, 4 unresolved discussions, all commit checks successful. pkg/sql/row_container.go, line 185 at r7 (raw file):
|
|
Review status: all files reviewed at latest revision, 4 unresolved discussions, all commit checks successful. pkg/sql/row_container.go, line 215 at r7 (raw file):
why Comments from Reviewable |
|
pkg/sql/row_container.go, line 215 at r7 (raw file):
|
The majority of RowContainer.AddRow() callers make copies of the rows; most are
unoptimized (one allocation per row).
Changing RowContainer to manage row storage internally, instead of using the
slices passed by the caller. We allocate rows in chunks, which reduces the
allocations as well as the overhead of storing a slice for every row. The
callers are simplified.
This change also fixes a couple of bugs that were uncovered:
CC @nvanbenschoten for the first commit
This change is